You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delete Elections function doesn't have a onlyOwner Modifier. This can make anyone to delete any election.
There are 2 deleteElection functions both in Elections.sol and ElectionStorage.sol where one calls the other.
Elections.sol
electionStorage.deleteElection(_election);
}
ElectionStorage.sol
function deleteElection (address _election) external {
Election election = Election(_election);
require(election.getStatus() == Election.Status.pending, "Cannot delete election after election has started");
...
}
Instead of adding a modifier in deleteElections we should add it inside the electionStorage and remove this function as this will just cause unnecessary loops and extra gas if modifier is added to Elections.sol.
The text was updated successfully, but these errors were encountered:
Problems:
Elections.sol
ElectionStorage.sol
Instead of adding a modifier in deleteElections we should add it inside the electionStorage and remove this function as this will just cause unnecessary loops and extra gas if modifier is added to Elections.sol.
The text was updated successfully, but these errors were encountered: