Skip to content

Integrate Smart Contract Voter Removal into Admin PageΒ #48

@pmora3003

Description

@pmora3003

🌟 Objective

Currently, removing voters must be done manually via Voyager, integrate the removeVoters function from the DeVote smart contract into the admin interface, allowing admins to remove voters directly from the frontend.

πŸ› οΈ Tasks

πŸ”— Backend Integration

Locate and use the removeVoters function from Frontend/hooks/use-contract.tsx.
Ensure correct interaction with the Starknet blockchain.

πŸ–₯️ Frontend Integration

Modify Frontend/app/admin/edit-proposal/[id]/page.tsx to trigger the voter removal function.
Ensure UI updates properly with loading states, success confirmation, and error messages.

πŸ›‘οΈ Error Handling & UX Enhancements

Implement loading indicators during pending transactions.
Display success messages when a voter is removed.
Handle errors (e.g., failed transactions, network errors).

βœ… Acceptance Criteria

Admins can remove voters from the UI without using Voyager.
The transaction is properly sent to Starknet.
UI provides real-time feedback with success/error messages.

πŸ“¦ Resources:

Smart contract: remove_voters in Backend/src/devote.cairo.
Frontend hook: Frontend/hooks/use-contract.tsx
Frontend component: Frontend/app/admin/edit-proposal/[id]/page.tsx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions