Transaction #2071

Hash cddca3d222aee59178a1030f7689a2af3024f5c6b9b16a161779fae803c598dd
Status Success
Timestamp 314 days ago - 5/19/2023, 1:22:15 AM UTC+0
Block 2071
Stamps Used 169
Burned Fee 0.01000000 TAU
From 42019189421e3a8f0e5db17eefeabfdd0cfcb06c482b6cf6ccadab992d044fa5 
Contract Name submission
Function Name submit_contract

Additional Info
Nonce 5
Processor 9d2dbfcc8cd20c8e41b24db367f215e4ac527dc6a2a0acdb4b6008d13d043ef8
Signature 6ee74e7d10409fc852d2e91eb45f991f5f1efde5b5800fce29d26e7cfd9da8a8db6586ce3f0d9cd4dee95b263ff4894d6865bcff39a07aba28b703e58a31260e
Stamps Supplied 655
Stamps per TAU 169

Kwargs

code state = Hash(default_value='') @construct def init(): # Initialize an empty dictionary for each user # Each dictionary will hold different categories of data # This contract could be expanded to have additional categories state['users'] = {} @export def register_user(username: str): # Register a new user # The user's data will be stored in a dictionary assert username not in state['users'], 'This username is already registered' state['users'][username] = {'contacts': [], 'addresses': [], 'documents': [], 'links': []} @export def add_data(username: str, category: str, item: str): # Add a new item to a user's category assert username in state['users'], 'This username is not registered' assert category in state['users'][username], 'This category does not exist' state['users'][username][category].append(item) @export def remove_data(username: str, category: str, item: str): # Remove an item from a user's category assert username in state['users'], 'This username is not registered' assert category in state['users'][username], 'This category does not exist' state['users'][username][category].remove(item) @export def get_data(username: str, category: str): # Get all items in a user's category assert username in state['users'], 'This username is not registered' assert category in state['users'][username], 'This category does not exist' return state['users'][username][category] @export def count_users(): # Count the number of registered users return len(state['users']) @export def count_category_items(username: str, category: str): # Count the number of items in a specific category for a specific user assert username in state['users'], 'This username is not registered' assert category in state['users'][username], 'This category does not exist' return len(state['users'][username][category]) @export def verify_user(username: str): # Verify if a user is registered return username in state['users']
name con_test_f0f2

State Changes

Contract con_test_f0f2
Variable __code__
New Value __state = Hash(default_value='', contract='con_test_f0f2', name='state') def ____(): __state['users'] = {} @__export('con_test_f0f2') def register_user(username: str): assert username not in __state['users' ], 'This username is already registered' __state['users'][username] = {'contacts': [], 'addresses': [], 'documents': [], 'links': []} @__export('con_test_f0f2') def add_data(username: str, category: str, item: str): assert username in __state['users'], 'This username is not registered' assert category in __state['users'][username ], 'This category does not exist' __state['users'][username][category].append(item) @__export('con_test_f0f2') def remove_data(username: str, category: str, item: str): assert username in __state['users'], 'This username is not registered' assert category in __state['users'][username ], 'This category does not exist' __state['users'][username][category].remove(item) @__export('con_test_f0f2') def get_data(username: str, category: str): assert username in __state['users'], 'This username is not registered' assert category in __state['users'][username ], 'This category does not exist' return __state['users'][username][category] @__export('con_test_f0f2') def count_users(): return len(__state['users']) @__export('con_test_f0f2') def count_category_items(username: str, category: str): assert username in __state['users'], 'This username is not registered' assert category in __state['users'][username ], 'This category does not exist' return len(__state['users'][username][category]) @__export('con_test_f0f2') def verify_user(username: str): return username in __state['users']
 
Contract con_test_f0f2
Variable __compiled__
New Value e3000000000000000000000000050000004000000073ba000000650064006401640264038d035a016404640584005a02650364018301650464069c0164076408840483015a0565036401830165046504650464099c03640a640b840483015a0665036401830165046504650464099c03640c640d840483015a0765036401830165046504640e9c02640f6410840483015a0865036401830164116412840083015a0965036401830165046504640e9c0264136414840483015a0a650364018301650464069c0164156416840483015a0b641753002918da00da0d636f6e5f746573745f66306632da0573746174652903da0d64656661756c745f76616c7565da08636f6e7472616374da046e616d65630000000000000000000000000300000043000000730c0000006900740064013c006400530029024eda0575736572732901da075f5f7374617465a900720900000072090000007201000000da045f5f5f5f0400000073020000000001720a0000002901da08757365726e616d65630100000000000000010000000500000043000000732e0000007c007400640119006b0773147401640283018201670067006700670064039c047400640119007c003c006400530029044e72070000007a235468697320757365726e616d6520697320616c726561647920726567697374657265642904da08636f6e7461637473da09616464726573736573da09646f63756d656e7473da056c696e6b7329027208000000da0e417373657274696f6e4572726f722901720b000000720900000072090000007201000000da0d72656769737465725f7573657208000000730800000000020e010601040172110000002903720b000000da0863617465676f7279da046974656d63030000000000000003000000030000004300000073460000007c007400640119006b06731474016402830182017c017400640119007c0019006b06732c74016403830182017400640119007c0019007c0119006a027c02830101006400530029044e72070000007a1f5468697320757365726e616d65206973206e6f7420726567697374657265647a1c546869732063617465676f727920646f6573206e6f74206578697374290372080000007210000000da06617070656e642903720b00000072120000007213000000720900000072090000007201000000da086164645f646174611000000073080000000002140112010601721500000063030000000000000003000000030000004300000073460000007c007400640119006b06731474016402830182017c017400640119007c0019006b06732c74016403830182017400640119007c0019007c0119006a027c02830101006400530029044e72070000007a1f5468697320757365726e616d65206973206e6f7420726567697374657265647a1c546869732063617465676f727920646f6573206e6f74206578697374290372080000007210000000da0672656d6f76652903720b00000072120000007213000000720900000072090000007201000000da0b72656d6f76655f64617461180000007308000000000214011201060172170000002902720b0000007212000000630200000000000000020000000300000043000000733c0000007c007400640119006b06731474016402830182017c017400640119007c0019006b06732c74016403830182017400640119007c0019007c011900530029044e72070000007a1f5468697320757365726e616d65206973206e6f7420726567697374657265647a1c546869732063617465676f727920646f6573206e6f742065786973742902720800000072100000002902720b0000007212000000720900000072090000007201000000da086765745f6461746120000000730800000000021401120106017218000000630000000000000000000000000300000043000000730c00000074007401640119008301530029024e72070000002902da036c656e72080000007209000000720900000072090000007201000000da0b636f756e745f75736572732800000073020000000002721a00000063020000000000000002000000030000004300000073400000007c007400640119006b06731474016402830182017c017400640119007c0019006b06732c740164038301820174027400640119007c0019007c0119008301530029044e72070000007a1f5468697320757365726e616d65206973206e6f7420726567697374657265647a1c546869732063617465676f727920646f6573206e6f7420657869737429037208000000721000000072190000002902720b0000007212000000720900000072090000007201000000da14636f756e745f63617465676f72795f6974656d732d00000073080000000002140112010601721b000000630100000000000000010000000300000043000000730c0000007c007400640119006b06530029024e7207000000290172080000002901720b000000720900000072090000007201000000da0b7665726966795f757365723500000073020000000002721c0000004e290cda04486173687208000000720a000000da085f5f6578706f7274da037374727211000000721500000072170000007218000000721a000000721b000000721c0000007209000000720900000072090000007201000000da083c6d6f64756c653e01000000731c0000000e030804060110070601140706011407060112071005060112070601
 
Contract con_test_f0f2
Variable __developer__
New Value 42019189421e3a8f0e5db17eefeabfdd0cfcb06c482b6cf6ccadab992d044fa5
 
Contract con_test_f0f2
Variable __owner__
New Value null
 
Contract con_test_f0f2
Variable __submitted__
New Value 2023,5,19,1,22,16,0
 
Contract con_test_f0f2
Variable state
Key users
New Value {}
 
Contract currency
Variable balances
Key 42019189421e3a8f0e5db17eefeabfdd0cfcb06c482b6cf6ccadab992d044fa5
New Value 643.69999683615386830