Transaction #2059

Hash 43ae97fdad3f8d981216004e9b8197e167f65977db66ac7b8419da87c49177a0
Status Failed
Error Message NameError("name 'state' is not defined",)
Timestamp 360 days ago - 5/19/2023, 12:47:18 AM UTC+0
Block 2059
Stamps Used 12
Burned Fee 0.00071006 TAU
From 42019189421e3a8f0e5db17eefeabfdd0cfcb06c482b6cf6ccadab992d044fa5 
Contract Name submission
Function Name submit_contract

Additional Info
Nonce 0
Processor e79133b02cd2a84e2ce5d24b2f44433f61f0db7e10acedfc241e94dff06f710a
Signature 9f57720385381a34ab2e04ca121dd8f5a16fefed00c592f0205ab8ddb3d150e0154c089b4b4d3466b7464b4a282fe950e5cbfa28529b6fc9173451840d020904
Stamps Supplied 65
Stamps per TAU 169

Kwargs

code # This is a sample Lamden Smart Contract for a personal data manager @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]
name con_test_f0f1

State Changes

Contract currency
Variable balances
Key 42019189421e3a8f0e5db17eefeabfdd0cfcb06c482b6cf6ccadab992d044fa5
New Value 684.31538149846155940