Transaction #918122

Hash eb0368bb32cdb4bedaa30c5c785a513bd10c46e5ad8d268caa05eb9af718cb0e
Status Success
Timestamp 711 days ago - 6/8/2022, 4:42:11 PM UTC+0
Block 871328
Stamps Used 227
Burned Fee 0.01343195 TAU
From ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89 
Contract Name submission
Function Name submit_contract

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

Kwargs

code # THIS IS LST003 STANDARD # You will be able to use these custom receiver names on the Lamden Wallet App and maybe Vault. # A mint costs 1 Tau import currency as tau collection_name = Variable() # The name of the collection for display collection_owner = Variable() # Only the owner can mint new NFTs for this collection collection_nfts = Hash(default_value=0) # All NFTs of the collection collection_balances = Hash(default_value=0) # All user balances of the NFTs collection_balances_approvals = Hash(default_value=0) # Approval amounts of certain NFTs @construct def seed(name: str, owner: str): collection_name.set(name) # Sets the name collection_owner.set(owner) # Sets the owner # function to mint a new NFT @export def mint_nft(name: str): name = name.lower() assert name.isalnum() == True, "Only alphanumeric characters allowed" assert name != "", "Name cannot be empty" assert collection_nfts[name] == 0, "Name already exists" assert len(name) >= 3, "The minimum length is 3 characters" tau.transfer_from(amount=1, to=collection_owner.get(), main_account=ctx.caller) collection_nfts[name] = {"description": "A domain in the Lamden Name Service", "ipfs_image_url": "", "metadata": {}, "amount": 1} # Adds NFT to collection with all details collection_balances[ctx.caller, name] = 1 # Mints the NFT # standard transfer function @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 don't have enough NFTs to send" collection_balances[ctx.caller, name] -= amount # Removes amount from sender collection_balances[to, name] += amount # Adds amount to receiver # allows other account to spend on your behalf @export def approve(amount: int, name: str, to: str): assert amount > 0, "Cannot approve negative amounts" collection_balances_approvals[ctx.caller, to, name] += amount # Approves certain amount for spending by another account # transfers on your behalf @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 # Removes Approval Amount collection_balances[main_account, name] -= amount # Removes amount from sender collection_balances[to, name] += amount # Adds amount to receiver
constructor_args {"name":"Lamden Name Service","owner":"ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89"}
name con_nameservice_v3

State Changes

Contract con_nameservice_v3
Variable collection_name
New Value Lamden Name Service
 
Contract con_nameservice_v3
Variable collection_owner
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract con_nameservice_v3
Variable __code__
New Value import currency as tau __collection_name = Variable(contract='con_nameservice_v3', name= 'collection_name') __collection_owner = Variable(contract='con_nameservice_v3', name= 'collection_owner') __collection_nfts = Hash(default_value=0, contract='con_nameservice_v3', name='collection_nfts') __collection_balances = Hash(default_value=0, contract='con_nameservice_v3', name='collection_balances') __collection_balances_approvals = Hash(default_value=0, contract= 'con_nameservice_v3', name='collection_balances_approvals') def ____(name: str, owner: str): __collection_name.set(name) __collection_owner.set(owner) @__export('con_nameservice_v3') def mint_nft(name: str): name = name.lower() assert name.isalnum() == True, 'Only alphanumeric characters allowed' assert name != '', 'Name cannot be empty' assert __collection_nfts[name] == 0, 'Name already exists' assert len(name) >= 3, 'The minimum length is 3 characters' tau.transfer_from(amount=1, to=__collection_owner.get(), main_account= ctx.caller) __collection_nfts[name] = {'description': 'A domain in the Lamden Name Service', 'ipfs_image_url': '', 'metadata': {}, 'amount': 1} __collection_balances[ctx.caller, name] = 1 @__export('con_nameservice_v3') 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 don't have enough NFTs to send" __collection_balances[ctx.caller, name] -= amount __collection_balances[to, name] += amount @__export('con_nameservice_v3') 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_nameservice_v3') 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_nameservice_v3
Variable __compiled__
New Value e3000000000000000000000000060000004000000073c4000000640064016c005a0165026402640364048d025a0365026402640564048d025a04650564006402640664078d035a06650564006402640864078d035a07650564006402640964078d035a0865096509640a9c02640b640c84045a0a650b640283016509640d9c01640e640f840483015a0c650b640283016509650d650964109c0364116412840483015a0e650b64028301650d6509650964139c0364146415840483015a0f650b640283016509650d6509650964169c0464176418840483015a10640153002919e9000000004eda12636f6e5f6e616d65736572766963655f7633da0f636f6c6c656374696f6e5f6e616d652902da08636f6e7472616374da046e616d65da10636f6c6c656374696f6e5f6f776e6572da0f636f6c6c656374696f6e5f6e6674732903da0d64656661756c745f76616c756572040000007205000000da13636f6c6c656374696f6e5f62616c616e636573da1d636f6c6c656374696f6e5f62616c616e6365735f617070726f76616c7329027205000000da056f776e6572630200000000000000020000000200000043000000731800000074006a017c008301010074026a017c01830101006400530029014e2903da115f5f636f6c6c656374696f6e5f6e616d65da03736574da125f5f636f6c6c656374696f6e5f6f776e657229027205000000720b000000a900720f000000da00da045f5f5f5f0e000000730400000000010a01721100000029017205000000630100000000000000010000000500000043000000738e0000007c006a0083007d007c006a01830064016b02731c74026402830182017c0064036b03732c740264048301820174037c00190064056b027340740264068301820174047c00830164076b057354740264088301820174056a06640974076a08830074096a0a640a8d030100640b640369006409640c9c0474037c003c006409740b74096a0a7c0066023c0064005300290d4e547a244f6e6c7920616c7068616e756d65726963206368617261637465727320616c6c6f77656472100000007a144e616d652063616e6e6f7420626520656d70747972010000007a134e616d6520616c726561647920657869737473e9030000007a22546865206d696e696d756d206c656e67746820697320332063686172616374657273e9010000002903da06616d6f756e74da02746fda0c6d61696e5f6163636f756e747a234120646f6d61696e20696e20746865204c616d64656e204e616d6520536572766963652904da0b6465736372697074696f6eda0e697066735f696d6167655f75726cda086d657461646174617214000000290cda056c6f776572da076973616c6e756dda0e417373657274696f6e4572726f72da115f5f636f6c6c656374696f6e5f6e667473da036c656eda03746175da0d7472616e736665725f66726f6d720e000000da03676574da03637478da0663616c6c6572da155f5f636f6c6c656374696f6e5f62616c616e63657329017205000000720f000000720f0000007210000000da086d696e745f6e66741300000073140000000002080114011001140114010c010a0204010e017225000000290372050000007214000000721500000063030000000000000003000000040000004300000073680000007c0164016b04731074006402830182017c0064036b0373207400640483018201740174026a037c00660219007c016b05733a7400640583018201740174026a037c006602050019007c01380003003c0074017c027c006602050019007c01370003003c006400530029064e72010000007a24596f752063616e6e6f74207472616e73666572206e6567617469766520616d6f756e747372100000007a37506c65617365207370656369667920746865206e616d65206f6620746865204e465420796f752077616e7420746f207472616e736665727a22596f7520646f6e2774206861766520656e6f756768204e46547320746f2073656e642904721c0000007224000000722200000072230000002903720500000072140000007215000000720f000000720f0000007210000000da087472616e7366657222000000730c0000000002100110010c010e01160172260000002903721400000072050000007215000000630300000000000000030000000400000043000000732c0000007c0064016b0473107400640283018201740174026a037c027c016603050019007c00370003003c006400530029034e72010000007a1f43616e6e6f7420617070726f7665206e6567617469766520616d6f756e74732904721c000000da1f5f5f636f6c6c656374696f6e5f62616c616e6365735f617070726f76616c73722200000072230000002903721400000072050000007215000000720f000000720f0000007210000000da07617070726f76652c00000073040000000002100172280000002904720500000072140000007215000000721600000063040000000000000004000000060000004300000073960000007c0164016b047310740064028301820174017c037c027c00660319007c016b05733c740064036a0274017c037c027c00660319007c0183028301820174037c037c00660219007c016b057354740064048301820174017c037c027c006603050019007c01380003003c0074037c037c006602050019007c01380003003c0074037c027c006602050019007c01370003003c006400530029054e72010000007a1e43616e6e6f742073656e64206e656761746976652062616c616e636573217a484e6f7420656e6f756768204e46547320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d7a184e6f7420656e6f756768204e46547320746f2073656e64212904721c0000007227000000da06666f726d6174722400000029047205000000721400000072150000007216000000720f000000720f00000072100000007220000000320000007312000000000210010c010c0114010a010e011601140172200000002911da0863757272656e6379721f000000da085661726961626c65720c000000720e000000da0448617368721d00000072240000007227000000da037374727211000000da085f5f6578706f72747225000000da03696e74722600000072280000007220000000720f000000720f000000720f0000007210000000da083c6d6f64756c653e01000000732600000008010401080104010801060108010601080104010a0310050601100e06011409060114050601
 
Contract con_nameservice_v3
Variable __owner__
New Value null
 
Contract con_nameservice_v3
Variable __submitted__
New Value 2022,6,8,16,42,13,0
 
Contract con_nameservice_v3
Variable __developer__
New Value ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
 
Contract currency
Variable balances
Key ff61544ea94eaaeb5df08ed863c4a938e9129aba6ceee5f31b6681bdede11b89
New Value 63.275669262647534519911632639222