Transaction #1200780

Hash 82f6a7fb8c38aaaf024640da715a74d7466d39a233fac4a31f8fb4e3f3dc1bb3
Status Success
Timestamp 528 days ago - 12/6/2022, 11:57:14 AM UTC+0
Block 1151564
Stamps Used 315
Burned Fee 0.01863905 TAU
From ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89 
Contract Name submission
Function Name submit_contract

Additional Info
SubBlock Number 0
Nonce 2449
Processor 5b09493df6c18d17cc883ebce54fcb1f5afbd507533417fe32c006009a9c3c4a
Signature 70105e15e5b781e1be791ca71365220deda3a7a1eae6dfda127919e872670f4de6af4959831b7713321b61fabdbb06a99b1d45015753c20cd615965edc39800e
Stamps Supplied 845
Stamps per TAU 169

Kwargs

code I = importlib collection_name = Variable() collection_owner = Variable() collection_nfts = Hash(default_value=0) collection_balances = Hash(default_value=0) collection_balances_approvals = Hash(default_value=0) pixelwhale = Variable() pixelwhale_info = Variable() @construct def seed(): collection_name.set("PixelWhale NFTs") collection_owner.set(ctx.caller) pixelwhale.set("con_pixel_whale_master_v1") pixelwhale_info.set("con_pixel_whale_info_v1") @export def update_pixelwhale_contract(contract:str): assert ctx.caller == collection_owner.get(), "Only the owner can call this" pixelwhale.set(contract) @export def update_pixelwhale_info_contract(contract:str): assert ctx.caller == collection_owner.get(), "Only the owner can call this" pixelwhale_info.set(contract) @export def wrap_nft(uid: str): #UID = https://www.pixelwhale.io/frames/>> 24f24ad8ed17ccde5b544edfc46f15ad10f51ba17fb89e9088fec0237c3467db << info = ForeignHash(foreign_contract=pixelwhale_info.get(), foreign_name='S') I.import_module(pixelwhale.get()).transfer_from(uid=uid, to=ctx.this, main_account=ctx.caller) if(collection_nfts[info[uid, 'name']] == 0): collection_nfts[info[uid, 'name']] = {"description": info[uid, 'description'], "ipfs_image_url": f"https://www.pixelwhale.io/gif/{uid}.gif" , "metadata": {"speed":info[uid, 'meta', 'speed'], "num_of_frames":info[uid, 'meta', 'num_of_frames'], "uid": uid}, "amount": 1} collection_balances[ctx.caller, info[uid, 'name']] = 1 else: transfer(name=info[uid, 'name'], amount=1, to=ctx.caller) @export def unwrap_nft(uid: str): #UID = https://www.pixelwhale.io/frames/>> 24f24ad8ed17ccde5b544edfc46f15ad10f51ba17fb89e9088fec0237c3467db << info = ForeignHash(foreign_contract=pixelwhale_info.get(), foreign_name='S') transfer_from(name=info[uid, 'name'], amount=1, to=ctx.this, main_account=ctx.caller) I.import_module(pixelwhale.get()).transfer(uid=uid, new_owner=ctx.caller) @export def transfer(name: str, amount:int, to: str): assert amount > 0, "You cannot transfer negative amounts" assert name != "", "Please specify the name of the NFT you want to transfer" assert collection_balances[ctx.caller, name] >= amount, "You dont have enough NFTs to send" collection_balances[ctx.caller, name] -= amount collection_balances[to, name] += amount # Adds amount to receiver @export def approve(amount: int, name: str, to: str): assert amount > 0, "Cannot approve negative amounts" collection_balances_approvals[ctx.caller, to, name] += amount @export def transfer_from(name:str, amount:int, to: str, main_account: str): assert amount > 0, "Cannot send negative balances!" assert collection_balances_approvals[main_account, to, name] >= amount, "Not enough NFTs approved to send! You have {} and are trying to spend {}".format(collection_balances_approvals[main_account, to, name], amount) assert collection_balances[main_account, name] >= amount, "Not enough NFTs to send!" collection_balances_approvals[main_account, to, name] -= amount collection_balances[main_account, name] -= amount collection_balances[to, name] += amount
name con_pixelwhale_wrapper

State Changes

Contract con_pixelwhale_wrapper
Variable collection_name
New Value PixelWhale NFTs
 
Contract con_pixelwhale_wrapper
Variable collection_owner
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract con_pixelwhale_wrapper
Variable pixelwhale
New Value con_pixel_whale_master_v1
 
Contract con_pixelwhale_wrapper
Variable pixelwhale_info
New Value con_pixel_whale_info_v1
 
Contract con_pixelwhale_wrapper
Variable __code__
New Value I = importlib __collection_name = Variable(contract='con_pixelwhale_wrapper', name= 'collection_name') __collection_owner = Variable(contract='con_pixelwhale_wrapper', name= 'collection_owner') __collection_nfts = Hash(default_value=0, contract='con_pixelwhale_wrapper', name='collection_nfts') __collection_balances = Hash(default_value=0, contract= 'con_pixelwhale_wrapper', name='collection_balances') __collection_balances_approvals = Hash(default_value=0, contract= 'con_pixelwhale_wrapper', name='collection_balances_approvals') __pixelwhale = Variable(contract='con_pixelwhale_wrapper', name='pixelwhale') __pixelwhale_info = Variable(contract='con_pixelwhale_wrapper', name= 'pixelwhale_info') def ____(): __collection_name.set('PixelWhale NFTs') __collection_owner.set(ctx.caller) __pixelwhale.set('con_pixel_whale_master_v1') __pixelwhale_info.set('con_pixel_whale_info_v1') @__export('con_pixelwhale_wrapper') def update_pixelwhale_contract(contract: str): assert ctx.caller == __collection_owner.get( ), 'Only the owner can call this' __pixelwhale.set(contract) @__export('con_pixelwhale_wrapper') def update_pixelwhale_info_contract(contract: str): assert ctx.caller == __collection_owner.get( ), 'Only the owner can call this' __pixelwhale_info.set(contract) @__export('con_pixelwhale_wrapper') def wrap_nft(uid: str): __info = ForeignHash(foreign_contract=__pixelwhale_info.get(), foreign_name='S', contract='con_pixelwhale_wrapper', name='info') I.import_module(__pixelwhale.get()).transfer_from(uid=uid, to=ctx.this, main_account=ctx.caller) if __collection_nfts[__info[uid, 'name']] == 0: __collection_nfts[__info[uid, 'name']] = {'description': __info[uid, 'description'], 'ipfs_image_url': f'https://www.pixelwhale.io/gif/{uid}.gif', 'metadata': { 'speed': __info[uid, 'meta', 'speed'], 'num_of_frames': __info[ uid, 'meta', 'num_of_frames'], 'uid': uid}, 'amount': 1} __collection_balances[ctx.caller, __info[uid, 'name']] = 1 else: transfer(name=__info[uid, 'name'], amount=1, to=ctx.caller) @__export('con_pixelwhale_wrapper') def unwrap_nft(uid: str): __info = ForeignHash(foreign_contract=__pixelwhale_info.get(), foreign_name='S', contract='con_pixelwhale_wrapper', name='info') transfer_from(name=__info[uid, 'name'], amount=1, to=ctx.this, main_account=ctx.caller) I.import_module(__pixelwhale.get()).transfer(uid=uid, new_owner=ctx.caller) @__export('con_pixelwhale_wrapper') def transfer(name: str, amount: int, to: str): assert amount > 0, 'You cannot transfer negative amounts' assert name != '', 'Please specify the name of the NFT you want to transfer' assert __collection_balances[ctx.caller, name ] >= amount, 'You dont have enough NFTs to send' __collection_balances[ctx.caller, name] -= amount __collection_balances[to, name] += amount @__export('con_pixelwhale_wrapper') def approve(amount: int, name: str, to: str): assert amount > 0, 'Cannot approve negative amounts' __collection_balances_approvals[ctx.caller, to, name] += amount @__export('con_pixelwhale_wrapper') def transfer_from(name: str, amount: int, to: str, main_account: str): assert amount > 0, 'Cannot send negative balances!' assert __collection_balances_approvals[main_account, to, name ] >= amount, 'Not enough NFTs approved to send! You have {} and are trying to spend {}'.format( __collection_balances_approvals[main_account, to, name], amount) assert __collection_balances[main_account, name ] >= amount, 'Not enough NFTs to send!' __collection_balances_approvals[main_account, to, name] -= amount __collection_balances[main_account, name] -= amount __collection_balances[to, name] += amount
 
Contract con_pixelwhale_wrapper
Variable __compiled__
New Value e30000000000000000000000000600000040000000731201000065005a0165026400640164028d025a0365026400640364028d025a04650564046400640564068d035a06650564046400640764068d035a07650564046400640864068d035a0865026400640964028d025a0965026400640a64028d025a0a640b640c84005a0b650c64008301650d640d9c01640e640f840483015a0e650c64008301650d640d9c0164106411840483015a0f650c64008301650d64129c0164136414840483015a10650c64008301650d64129c0164156416840483015a11650c64008301650d6512650d64179c0364186419840483015a13650c640083016512650d650d641a9c03641b641c840483015a14650c64008301650d6512650d650d641d9c04641e641f840483015a15642053002921da16636f6e5f706978656c7768616c655f77726170706572da0f636f6c6c656374696f6e5f6e616d652902da08636f6e7472616374da046e616d65da10636f6c6c656374696f6e5f6f776e6572e900000000da0f636f6c6c656374696f6e5f6e6674732903da0d64656661756c745f76616c756572030000007204000000da13636f6c6c656374696f6e5f62616c616e636573da1d636f6c6c656374696f6e5f62616c616e6365735f617070726f76616c73da0a706978656c7768616c65da0f706978656c7768616c655f696e666f630000000000000000000000000200000043000000732e00000074006a0164018301010074026a0174036a048301010074056a0164028301010074066a016403830101006400530029044e7a0f506978656c5768616c65204e465473da19636f6e5f706978656c5f7768616c655f6d61737465725f7631da17636f6e5f706978656c5f7768616c655f696e666f5f76312907da115f5f636f6c6c656374696f6e5f6e616d65da03736574da125f5f636f6c6c656374696f6e5f6f776e6572da03637478da0663616c6c6572da0c5f5f706978656c7768616c65da115f5f706978656c7768616c655f696e666fa90072160000007216000000da00da045f5f5f5f11000000730800000000010a010c010a01721800000029017203000000630100000000000000010000000200000043000000732400000074006a0174026a0383006b027316740464018301820174056a067c00830101006400530029024e7a1c4f6e6c7920746865206f776e65722063616e2063616c6c20746869732907721200000072130000007211000000da03676574da0e417373657274696f6e4572726f727214000000721000000029017203000000721600000072160000007217000000da1a7570646174655f706978656c7768616c655f636f6e7472616374180000007306000000000210010601721b000000630100000000000000010000000200000043000000732400000074006a0174026a0383006b027316740464018301820174056a067c00830101006400530029024e7a1c4f6e6c7920746865206f776e65722063616e2063616c6c207468697329077212000000721300000072110000007219000000721a0000007215000000721000000029017203000000721600000072160000007217000000da1f7570646174655f706978656c7768616c655f696e666f5f636f6e74726163741f0000007306000000000210010601721c0000002901da0375696463010000000000000002000000070000004300000073c0000000740074016a02830064016402640364048d047d0174036a0474056a02830083016a067c0074076a0874076a0964058d030100740a7c017c00640666021900190064076b0272a47c017c0064086602190064097c009b00640a9d037c017c00640b640c660319007c017c00640b640d660319007c00640e9c03640f64109c04740a7c017c006406660219003c00640f740b74076a097c017c0064066602190066023c006e18740c7c017c00640666021900640f74076a0964118d0301006400530029124eda01537201000000da04696e666f2904da10666f726569676e5f636f6e7472616374da0c666f726569676e5f6e616d65720300000072040000002903721d000000da02746fda0c6d61696e5f6163636f756e7472040000007206000000da0b6465736372697074696f6e7a1e68747470733a2f2f7777772e706978656c7768616c652e696f2f6769662f7a042e676966da046d657461da057370656564da0d6e756d5f6f665f6672616d6573290372260000007227000000721d000000e90100000029047224000000da0e697066735f696d6167655f75726cda086d65746164617461da06616d6f756e7429037204000000722b0000007222000000290dda0b466f726569676e4861736872150000007219000000da0149da0d696d706f72745f6d6f64756c657214000000da0d7472616e736665725f66726f6d7212000000da04746869737213000000da115f5f636f6c6c656374696f6e5f6e667473da155f5f636f6c6c656374696f6e5f62616c616e636573da087472616e736665722902721d000000da065f5f696e666f721600000072160000007217000000da08777261705f6e6674260000007318000000000208010c0114010a011401040106010a010e01240118027235000000630100000000000000020000000600000043000000734e000000740074016a02830064016402640364048d047d0174037c017c00640566021900640674046a0574046a0664078d04010074076a0874096a02830083016a0a7c0074046a0664088d0201006400530029094e721e0000007201000000721f000000290472200000007221000000720300000072040000007204000000722800000029047204000000722b000000722200000072230000002902721d000000da096e65775f6f776e6572290b722c00000072150000007219000000722f000000721200000072300000007213000000722d000000722e000000721400000072330000002902721d0000007234000000721600000072160000007217000000da0a756e777261705f6e667437000000730a000000000208010c0112010a01723700000029037204000000722b000000722200000063030000000000000003000000040000004300000073680000007c0164016b04731074006402830182017c0064036b0373207400640483018201740174026a037c00660219007c016b05733a7400640583018201740174026a037c006602050019007c01380003003c0074017c027c006602050019007c01370003003c006400530029064e72060000007a24596f752063616e6e6f74207472616e73666572206e6567617469766520616d6f756e747372170000007a37506c65617365207370656369667920746865206e616d65206f6620746865204e465420796f752077616e7420746f207472616e736665727a21596f7520646f6e74206861766520656e6f756768204e46547320746f2073656e642904721a00000072320000007212000000721300000029037204000000722b0000007222000000721600000072160000007217000000723300000040000000730c0000000002100110010c010e01160172330000002903722b00000072040000007222000000630300000000000000030000000400000043000000732c0000007c0064016b0473107400640283018201740174026a037c027c016603050019007c00370003003c006400530029034e72060000007a1f43616e6e6f7420617070726f7665206e6567617469766520616d6f756e74732904721a000000da1f5f5f636f6c6c656374696f6e5f62616c616e6365735f617070726f76616c73721200000072130000002903722b00000072040000007222000000721600000072160000007217000000da07617070726f76654a000000730400000000021001723900000029047204000000722b0000007222000000722300000063040000000000000004000000060000004300000073960000007c0164016b047310740064028301820174017c037c027c00660319007c016b05733c740064036a0274017c037c027c00660319007c0183028301820174037c037c00660219007c016b057354740064048301820174017c037c027c006603050019007c01380003003c0074037c037c006602050019007c01380003003c0074037c027c006602050019007c01370003003c006400530029054e72060000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a484e6f7420656e6f756768204e46547320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a184e6f7420656e6f756768204e46547320746f2073656e64212904721a0000007238000000da06666f726d6174723200000029047204000000722b00000072220000007223000000721600000072160000007217000000722f000000500000007312000000000210010c010c0114010a010e0116011401722f0000004e2916da09696d706f72746c6962722d000000da085661726961626c65720f0000007211000000da0448617368723100000072320000007238000000721400000072150000007218000000da085f5f6578706f7274da03737472721b000000721c00000072350000007237000000da03696e7472330000007239000000722f0000007216000000721600000072160000007217000000da083c6d6f64756c653e010000007338000000040104010801040108010601080104010a0104010a010c010401080308070601100606011006060110100601100806011409060114050601
 
Contract con_pixelwhale_wrapper
Variable __owner__
New Value null
 
Contract con_pixelwhale_wrapper
Variable __submitted__
New Value 2022,12,6,11,57,16,0
 
Contract con_pixelwhale_wrapper
Variable __developer__
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract currency
Variable balances
Key ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
New Value 53.090352334190856827389194285358