Transaction #60639

Hash 96ac533b61c9e09566462fef008435003a313f0458eed76c8047533bee337bb3
Status Success
Timestamp 1121 days ago - 4/11/2021, 6:52:51 PM UTC+0
Block 60674
Stamps Used 438
Burned Fee 0.06738462 TAU
From fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 202
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 2b78467c017860a3ff2d7fa48dfa605d0cde71f1d8a70b22cd5ad60e994c4ca03de6b58f4f7b19dd2fef22b3262fa928fd0008f5dfc4075766d300dfb3999d03
Stamps Supplied 3250
Stamps per TAU 65

Kwargs

code import currency I = importlib S = Hash(default_value='') balances = Hash(default_value=0) metadata = Hash(default_value=0) @construct def seed(): S['thing_info_contract'] = 'con_pixel_whale_info_v1' # LST002 metadata['operator'] = ctx.caller metadata['things_name'] = 'Pixel Whales v1' metadata['things_description'] = 'On-chain Pixel Animations you can BUY and SELL!' # LST002 @export def change_metadata(key: str, value: Any): assert ctx.caller == metadata['operator'], 'Only operator can set metadata!' metadata[key] = value @export def create_thing(thing_string: str, name: str, description: str, meta: dict = {}): thing_info = I.import_module(S['thing_info_contract']) sender = ctx.caller thing_uid = thing_info.add_thing(thing_string, name, description, meta, sender) add_to_balance(sender) return thing_uid @export def buy_thing(uid: str): thing_info = I.import_module(S['thing_info_contract']) sender = ctx.caller owner = thing_info.get_owner(uid) creator = thing_info.get_creator(uid) assert_already_owned(uid, sender) price_amount = thing_info.get_price_amount(uid) royalty_percent = thing_info.get_royalty_amount(uid) assert price_amount, uid + ' is not for sale' assert price_amount > 0, uid + ' is not for sale' price_hold = thing_info.get_price_hold(uid) if price_hold != '': assert sender == price_hold, uid + ' is being held for ' + price_hold if royalty_percent > 0: # calculate the royalty royalty_amount = price_amount * (royalty_percent / 100) # calculate the amount that goes to the seller net_amount = price_amount - royalty_amount # send royalty to creator currency.transfer_from(royalty_amount, creator, sender) else: net_amount = price_amount # send currency to current owner currency.transfer_from(net_amount, owner, sender) # if the TAU transfers did not take place then this part will not execute as the whole method will fail transfer_ownership(uid, sender) @export def sell_thing(uid: str, amount: float): # make sure the caller owns the item assert_ownership(uid, ctx.caller) thing_info = I.import_module(S['thing_info_contract']) thing_info.set_price(uid, amount, '') @export def sell_thing_to(uid: str, amount: float, hold: str): # make sure the caller owns the item assert_ownership(uid, ctx.caller) thing_info = I.import_module(S['thing_info_contract']) thing_info.set_price(uid, amount, hold) @export def transfer(uid: str, new_owner: str): sender = ctx.caller # make sure the caller owns the item assert_ownership(uid, sender) #Make sure the new owner doesn't already own it (sending to themselves) assert_already_owned(uid, new_owner) #transfer the item transfer_ownership(uid, new_owner) @export def approve(uid: str, to: str): sender = ctx.caller assert_ownership(uid, sender) balances[sender, uid, to] = True @export def revoke(uid: str, to: str): balances[ctx.caller, uid, to] = None @export def transfer_from(uid: str, to: str, main_account: str): sender = ctx.caller assert balances[main_account, uid, sender], "You have not been given approval to transfer this user's item." assert_ownership(uid, main_account) # transfer assert_already_owned(uid, to) transfer_ownership(uid, to) # revoke the approval balances[main_account, uid, sender] = None @export def like_thing(uid: str): sender = ctx.caller assert S['liked', uid, sender] == '', sender + " already liked " + uid thing_info = I.import_module(S['thing_info_contract']) thing_info.like_thing(uid) S['liked', uid, sender] = True @export def prove_ownership(uid: str, code: str): sender = ctx.caller assert_ownership(uid, sender) thing_info = I.import_module(S['thing_info_contract']) thing_info.set_proof(uid, code) def assert_ownership(uid: str, sender): thing_info = I.import_module(S['thing_info_contract']) owner = thing_info.get_owner(uid) assert owner == sender, uid + ' not owned by ' + sender def assert_already_owned(uid: str, sender): thing_info = I.import_module(S['thing_info_contract']) owner = thing_info.get_owner(uid) assert owner != sender, uid + ' already owned by ' + sender def transfer_ownership(uid:str, new_owner: str): thing_info = I.import_module(S['thing_info_contract']) old_owner = thing_info.get_owner(uid) #change ownership to new owner thing_info.set_owner(uid, new_owner) # if item was for sale make it no longer for sale if thing_info.get_price_amount(uid) > 0: thing_info.set_price(uid, 0, '') #adjust balances add_to_balance(new_owner) subtract_from_balance(old_owner) def add_to_balance(holder: str): if balances[holder] is None: balances[holder] = 1 else: balances[holder] = balances[holder] + 1 def subtract_from_balance(holder: str): if balances[holder] is None: balances[holder] = 0 else: balances[holder] = balances[holder] - 1
name con_pixel_whale_master_v1

State Changes

Contract con_pixel_whale_master_v1
Variable S
Key thing_info_contract
New Value con_pixel_whale_info_v1
 
Contract con_pixel_whale_master_v1
Variable metadata
Key operator
New Value fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
 
Contract con_pixel_whale_master_v1
Variable metadata
Key things_name
New Value Pixel Whales v1
 
Contract con_pixel_whale_master_v1
Variable metadata
Key things_description
New Value On-chain Pixel Animations you can BUY and SELL!
 
Contract con_pixel_whale_master_v1
Variable __code__
New Value import currency I = importlib __S = Hash(default_value='', contract='con_pixel_whale_master_v1', name='S') __balances = Hash(default_value=0, contract='con_pixel_whale_master_v1', name='balances') __metadata = Hash(default_value=0, contract='con_pixel_whale_master_v1', name='metadata') def ____(): __S['thing_info_contract'] = 'con_pixel_whale_info_v1' __metadata['operator'] = ctx.caller __metadata['things_name'] = 'Pixel Whales v1' __metadata['things_description' ] = 'On-chain Pixel Animations you can BUY and SELL!' @__export('con_pixel_whale_master_v1') def change_metadata(key: str, value: Any): assert ctx.caller == __metadata['operator' ], 'Only operator can set metadata!' __metadata[key] = value @__export('con_pixel_whale_master_v1') def create_thing(thing_string: str, name: str, description: str, meta: dict={} ): thing_info = I.import_module(__S['thing_info_contract']) sender = ctx.caller thing_uid = thing_info.add_thing(thing_string, name, description, meta, sender) __add_to_balance(sender) return thing_uid @__export('con_pixel_whale_master_v1') def buy_thing(uid: str): thing_info = I.import_module(__S['thing_info_contract']) sender = ctx.caller owner = thing_info.get_owner(uid) creator = thing_info.get_creator(uid) __assert_already_owned(uid, sender) price_amount = thing_info.get_price_amount(uid) royalty_percent = thing_info.get_royalty_amount(uid) assert price_amount, uid + ' is not for sale' assert price_amount > 0, uid + ' is not for sale' price_hold = thing_info.get_price_hold(uid) if price_hold != '': assert sender == price_hold, uid + ' is being held for ' + price_hold if royalty_percent > 0: royalty_amount = price_amount * (royalty_percent / 100) net_amount = price_amount - royalty_amount currency.transfer_from(royalty_amount, creator, sender) else: net_amount = price_amount currency.transfer_from(net_amount, owner, sender) __transfer_ownership(uid, sender) @__export('con_pixel_whale_master_v1') def sell_thing(uid: str, amount: float): __assert_ownership(uid, ctx.caller) thing_info = I.import_module(__S['thing_info_contract']) thing_info.set_price(uid, amount, '') @__export('con_pixel_whale_master_v1') def sell_thing_to(uid: str, amount: float, hold: str): __assert_ownership(uid, ctx.caller) thing_info = I.import_module(__S['thing_info_contract']) thing_info.set_price(uid, amount, hold) @__export('con_pixel_whale_master_v1') def transfer(uid: str, new_owner: str): sender = ctx.caller __assert_ownership(uid, sender) __assert_already_owned(uid, new_owner) __transfer_ownership(uid, new_owner) @__export('con_pixel_whale_master_v1') def approve(uid: str, to: str): sender = ctx.caller __assert_ownership(uid, sender) __balances[sender, uid, to] = True @__export('con_pixel_whale_master_v1') def revoke(uid: str, to: str): __balances[ctx.caller, uid, to] = None @__export('con_pixel_whale_master_v1') def transfer_from(uid: str, to: str, main_account: str): sender = ctx.caller assert __balances[main_account, uid, sender ], "You have not been given approval to transfer this user's item." __assert_ownership(uid, main_account) __assert_already_owned(uid, to) __transfer_ownership(uid, to) __balances[main_account, uid, sender] = None @__export('con_pixel_whale_master_v1') def like_thing(uid: str): sender = ctx.caller assert __S['liked', uid, sender] == '', sender + ' already liked ' + uid thing_info = I.import_module(__S['thing_info_contract']) thing_info.like_thing(uid) __S['liked', uid, sender] = True @__export('con_pixel_whale_master_v1') def prove_ownership(uid: str, code: str): sender = ctx.caller __assert_ownership(uid, sender) thing_info = I.import_module(__S['thing_info_contract']) thing_info.set_proof(uid, code) def __assert_ownership(uid: str, sender): thing_info = I.import_module(__S['thing_info_contract']) owner = thing_info.get_owner(uid) assert owner == sender, uid + ' not owned by ' + sender def __assert_already_owned(uid: str, sender): thing_info = I.import_module(__S['thing_info_contract']) owner = thing_info.get_owner(uid) assert owner != sender, uid + ' already owned by ' + sender def __transfer_ownership(uid: str, new_owner: str): thing_info = I.import_module(__S['thing_info_contract']) old_owner = thing_info.get_owner(uid) thing_info.set_owner(uid, new_owner) if thing_info.get_price_amount(uid) > 0: thing_info.set_price(uid, 0, '') __add_to_balance(new_owner) __subtract_from_balance(old_owner) def __add_to_balance(holder: str): if __balances[holder] is None: __balances[holder] = 1 else: __balances[holder] = __balances[holder] + 1 def __subtract_from_balance(holder: str): if __balances[holder] is None: __balances[holder] = 0 else: __balances[holder] = __balances[holder] - 1
 
Contract con_pixel_whale_master_v1
Variable __compiled__
New Value e30000000000000000000000000700000040000000739a010000640064016c005a0065015a02650364026403640464058d035a04650364006403640664058d035a05650364006403640764058d035a066408640984005a076508640383016509650a640a9c02640b640c840483015a0b65086403830169006601650965096509650c640d9c04640e640f840583015a0d650864038301650964109c0164116412840483015a0e6508640383016509650f64139c0264146415840483015a106508640383016509650f650964169c0364176418840483015a116508640383016509650964199c02641a641b840483015a1265086403830165096509641c9c02641d641e840483015a1365086403830165096509641c9c02641f6420840483015a1465086403830165096509650964219c0364226423840483015a15650864038301650964109c0164246425840483015a166508640383016509650964269c0264276428840483015a17650964109c016429642a84045a18650964109c01642b642c84045a196509650964199c02642d642e84045a1a6509642f9c016430643184045a1b6509642f9c016432643384045a1c640153002934e9000000004eda00da19636f6e5f706978656c5f7768616c655f6d61737465725f7631da01532903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65da0862616c616e636573da086d6574616461746163000000000000000000000000030000004300000073260000006401740064023c0074016a02740364033c006404740364053c006406740364073c006400530029084eda17636f6e5f706978656c5f7768616c655f696e666f5f7631da137468696e675f696e666f5f636f6e7472616374da086f70657261746f727a0f506978656c205768616c6573207631da0b7468696e67735f6e616d657a2f4f6e2d636861696e20506978656c20416e696d6174696f6e7320796f752063616e2042555920616e642053454c4c21da127468696e67735f6465736372697074696f6e2904da035f5f53da03637478da0663616c6c6572da0a5f5f6d65746164617461a900721300000072130000007202000000da045f5f5f5f0a0000007308000000000108010a01080272140000002902da036b6579da0576616c7565630200000000000000020000000300000043000000732200000074006a017402640119006b02731674036402830182017c0174027c003c006400530029034e720c0000007a1f4f6e6c79206f70657261746f722063616e20736574206d65746164617461212904721000000072110000007212000000da0e417373657274696f6e4572726f72290272150000007216000000721300000072130000007202000000da0f6368616e67655f6d6574616461746112000000730600000000021001060172180000002904da0c7468696e675f737472696e677207000000da0b6465736372697074696f6eda046d657461630400000000000000070000000600000043000000733200000074006a0174026401190083017d0474036a047d057c046a057c007c017c027c037c0583057d0674067c05830101007c06530029024e720b0000002907da0149da0d696d706f72745f6d6f64756c65720f00000072100000007211000000da096164645f7468696e67da105f5f6164645f746f5f62616c616e6365290772190000007207000000721a000000721b000000da0a7468696e675f696e666fda0673656e646572da097468696e675f756964721300000072130000007202000000da0c6372656174655f7468696e6719000000730c00000000030e0106010c010601080172230000002901da037569646301000000000000000a000000040000004300000073e000000074006a0174026401190083017d0174036a047d027c016a057c0083017d037c016a067c0083017d0474077c007c02830201007c016a087c0083017d057c016a097c0083017d067c057356740a7c0064021700830182017c0564036b04736a740a7c0064021700830182017c016a0b7c0083017d077c0764046b0372947c027c076b027394740a7c00640517007c071700830182017c0664036b0472c07c057c0664061b0014007d087c057c0818007d09740c6a0d7c087c047c02830301006e047c057d09740c6a0d7c097c037c0283030100740e7c007c02830201006400530029074e720b0000007a10206973206e6f7420666f722073616c65720100000072020000007a13206973206265696e672068656c6420666f7220e964000000290f721c000000721d000000720f00000072100000007211000000da096765745f6f776e6572da0b6765745f63726561746f72da165f5f6173736572745f616c72656164795f6f776e6564da106765745f70726963655f616d6f756e74da126765745f726f79616c74795f616d6f756e747217000000da0e6765745f70726963655f686f6c64da0863757272656e6379da0d7472616e736665725f66726f6dda145f5f7472616e736665725f6f776e657273686970290a722400000072200000007221000000da056f776e6572da0763726561746f72da0c70726963655f616d6f756e74da0f726f79616c74795f70657263656e74da0a70726963655f686f6c64da0e726f79616c74795f616d6f756e74da0a6e65745f616d6f756e74721300000072130000007202000000da096275795f7468696e6724000000732600000000020e0106010a010a010a010a010a01100114010a010801180108010c010801100204010e01723600000029027224000000da06616d6f756e74630200000000000000030000000400000043000000732c00000074007c0074016a028302010074036a0474056401190083017d027c026a067c007c016402830301006400530029034e720b00000072020000002907da125f5f6173736572745f6f776e65727368697072100000007211000000721c000000721d000000720f000000da097365745f70726963652903722400000072370000007220000000721300000072130000007202000000da0a73656c6c5f7468696e673c000000730600000000020c010e01723a000000290372240000007237000000da04686f6c64630300000000000000040000000400000043000000732c00000074007c0074016a028302010074036a0474056401190083017d037c036a067c007c017c02830301006400530029024e720b0000002907723800000072100000007211000000721c000000721d000000720f0000007239000000290472240000007237000000723b0000007220000000721300000072130000007202000000da0d73656c6c5f7468696e675f746f43000000730600000000020c010e01723c00000029027224000000da096e65775f6f776e6572630200000000000000030000000300000043000000732800000074006a017d0274027c007c028302010074037c007c018302010074047c007c01830201006400530029014e29057210000000721100000072380000007228000000722e00000029037224000000723d0000007221000000721300000072130000007202000000da087472616e736665724a0000007308000000000206010a010a01723e00000029027224000000da02746f630200000000000000030000000500000043000000732200000074006a017d0274027c007c0283020100640174037c027c007c0166033c006400530029024e542904721000000072110000007238000000da0a5f5f62616c616e63657329037224000000723f0000007221000000721300000072130000007202000000da07617070726f7665520000007306000000000206010a01724100000063020000000000000002000000050000004300000073140000006400740074016a027c007c0166033c006400530029014e290372400000007210000000721100000029027224000000723f000000721300000072130000007202000000da067265766f6b655900000073020000000002724200000029037224000000723f000000da0c6d61696e5f6163636f756e74630300000000000000040000000500000043000000734c00000074006a017d0374027c027c007c0366031900731c740364018301820174047c007c028302010074057c007c018302010074067c007c0183020100640074027c027c007c0366033c006400530029024e7a3e596f752068617665206e6f74206265656e20676976656e20617070726f76616c20746f207472616e73666572207468697320757365722773206974656d2e2907721000000072110000007240000000721700000072380000007228000000722e00000029047224000000723f00000072430000007221000000721300000072130000007202000000722d0000005e000000730e00000000020601100106010a010a010a01722d000000630100000000000000030000000500000043000000735200000074006a017d01740264017c007c016603190064026b02732874037c01640317007c0017008301820174046a0574026404190083017d027c026a067c00830101006405740264017c007c0166033c006400530029064eda056c696b656472020000007a0f20616c7265616479206c696b656420720b00000054290772100000007211000000720f0000007217000000721c000000721d000000da0a6c696b655f7468696e672903722400000072210000007220000000721300000072130000007202000000724500000069000000730a0000000002060122010e010a01724500000029027224000000da04636f6465630200000000000000040000000300000043000000732e00000074006a017d0274027c007c028302010074036a0474056401190083017d037c036a067c007c01830201006400530029024e720b0000002907721000000072110000007238000000721c000000721d000000720f000000da097365745f70726f6f6629047224000000724600000072210000007220000000721300000072130000007202000000da0f70726f76655f6f776e657273686970720000007308000000000206010a010e017248000000630200000000000000040000000300000043000000733400000074006a0174026401190083017d027c026a037c0083017d037c037c016b02733074047c00640217007c011700830182016400530029034e720b0000007a0e206e6f74206f776e6564206279202905721c000000721d000000720f000000722600000072170000002904722400000072210000007220000000722f00000072130000007213000000720200000072380000007a000000730600000000010e010a017238000000630200000000000000040000000300000043000000733400000074006a0174026401190083017d027c026a037c0083017d037c037c016b03733074047c00640217007c011700830182016400530029034e720b0000007a1220616c7265616479206f776e6564206279202905721c000000721d000000720f000000722600000072170000002904722400000072210000007220000000722f000000721300000072130000007202000000722800000080000000730600000000010e010a017228000000630200000000000000040000000400000043000000735400000074006a0174026401190083017d027c026a037c0083017d037c026a047c007c01830201007c026a057c00830164026b0472407c026a067c00640264038303010074077c018301010074087c03830101006400530029044e720b000000720100000072020000002909721c000000721d000000720f0000007226000000da097365745f6f776e657272290000007239000000721f000000da175f5f73756274726163745f66726f6d5f62616c616e636529047224000000723d0000007220000000da096f6c645f6f776e6572721300000072130000007202000000722e00000086000000730e00000000010e010a010c010e010e010801722e0000002901da06686f6c646572630100000000000000010000000300000043000000732a00000074007c00190064006b087216640174007c003c006e1074007c0019006401170074007c003c006400530029024ee901000000290172400000002901724c000000721300000072130000007202000000721f00000090000000730600000000010c010a02721f000000630100000000000000010000000300000043000000732a00000074007c00190064006b087216640174007c003c006e1074007c0019006402180074007c003c006400530029034e7201000000724d000000290172400000002901724c000000721300000072130000007202000000724a00000097000000730600000000010c010a02724a000000291d722c000000da09696d706f72746c6962721c000000da0448617368720f000000724000000072120000007214000000da085f5f6578706f7274da03737472da03416e797218000000da046469637472230000007236000000da05666c6f6174723a000000723c000000723e00000072410000007242000000722d0000007245000000724800000072380000007228000000722e000000721f000000724a0000007213000000721300000072130000007202000000da083c6d6f64756c653e010000007344000000080104010e01060108010601080308080601120606011a0a0601101706011206060114060601120706011206060112040601140a06011008060112070e060e06100a0e07
 
Contract con_pixel_whale_master_v1
Variable __owner__
New Value null
 
Contract con_pixel_whale_master_v1
Variable __submitted__
New Value 2021,4,11,18,52,52,0
 
Contract con_pixel_whale_master_v1
Variable __developer__
New Value fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
 
Contract currency
Variable balances
Key fcefe7743fa70c97ae2d5290fd673070da4b0293da095f0ae8aceccf5e62b6a1
New Value 306584.632200420598289650