-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Integrate Smart Contract User Creation into the Admin Page
🌟 Objective
Integrate the create_new_person function from the DeVote smart contract into the admin interface, allowing admins to register new users directly from the frontend instead of through Voyager.
🛠️ Tasks
🔗 Backend Integration
Locate and use the createPersonOnChain function from Frontend/hooks/use-contract.tsx
Ensure proper interaction with the Starknet blockchain, including handling wallet authentication and transaction submission.
🖥️ Frontend Integration
Modify CreateUserModal.tsx in Frontend/app/components/ to trigger the user creation function.
Ensure the UI provides loading states, success confirmation, and error messages.
🛡️ Error Handling & UX Enhancements
Display user-friendly loading indicators while the transaction is pending.
Show clear success messages when a user is created.
Implement error handling (e.g., invalid inputs, failed transactions, network errors).
✅ Acceptance Criteria
Admins can create new users from the UI without using Voyager.
Transactions are correctly sent to the Starknet blockchain.
UI provides real-time feedback on the status of the transaction.
Code follows Starknet’s best practices for interacting with smart contracts.
📦 Resources:
Smart contract: create_new_person in Backend/src/devote.cairo
Frontend modal: CreateUserModal.tsx in Frontend/app/components/