-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix vulnerable vote function #16
Closed
a-singh09
wants to merge
95
commits into
AOSSIE-Org:main
from
a-singh09:Fix-Vulnerable-Vote-Function
Closed
Fix vulnerable vote function #16
a-singh09
wants to merge
95
commits into
AOSSIE-Org:main
from
a-singh09:Fix-Vulnerable-Vote-Function
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merge gsoc-2021 branch with develop See merge request aossie/agora-blockchain!22
Added anaytics api See merge request aossie/agora-blockchain!24
… and statistics function
…ignatures according to convention
Base of new architecture ready See merge request aossie/agora-blockchain!36
Ready for integration with frontend See merge request aossie/agora-blockchain!39
Hardhat integrated See merge request aossie/agora-blockchain!38
Added documentation for final evaluation See merge request aossie/agora-blockchain!42
Final evaluations documentation See merge request aossie/agora-blockchain!43
Updated the docs See merge request aossie/agora-blockchain!45
# Conflicts: # README.md
…ate, Fix UI and UX of DAPP
Added documentation See merge request aossie/agora-blockchain!123
Document See merge request aossie/agora-blockchain!124
Fix date See merge request aossie/agora-blockchain!128
new update See merge request aossie/agora-blockchain!129
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
Fixes #15
The original implementation of the vote function in the smart contract allowed for unauthorised voting by manipulating the
_voter
parameter.Solution:
The solution involves ensuring that only authenticated users are allowed to cast votes. This is achieved by implementing an authentication check that verifies the sender's identity before allowing them to vote. The updated vote function now checks if the sender is authenticated before proceeding with the voting process. The authentication was already being done in
Authentication.sol
, so its instance is created inElection.sol
and later arequire()
statement is used to allow only authenticated users.Changes Made:
Election.sol:
_authContractAddress
for the Authentication contract address.authContract.getAuthStatus(msg.sender)
before proceeding with the voting logic.ElectionFactory.sol:
_authContractAddress
for the Authentication contract address.ElectionOrganizer.sol:
_authContractAddress
for the Authentication contract address.