Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Vulnerable Vote Function #24

Closed

Conversation

Ronnieraj37
Copy link
Contributor

@Ronnieraj37 Ronnieraj37 commented Mar 19, 2024

Description

Fixes #15

I've fixed the Vulnerable Vote function which allowed attackers to loop the function to execute indefinitely. Additionaly :

  • Removed the Voter function as it was repeating the castVote functionality
  • Added getUserStatusForVote from the Authentication Instance in Election.sol
  • Added a modifier of OnlyOwner in Ballot Contract to ensure only the owner can Vote
  • Replace the _voter in ballot.vote(_voter,_candidateID, weight,voteArr); with msg.sender

Type of change

Please mark the options that are relevant.

  • Updated UI/UX
  • Improved the business logic of code
  • Added new feature
  • Other

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@Ronnieraj37 Ronnieraj37 changed the title Fixing Vulnerable Vote Function Fixed Vulnerable Vote Function Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant