diff --git a/Foundry_Contracts/src/Voting.sol b/Foundry_Contracts/src/Voting.sol index c5a6737..1c26886 100644 --- a/Foundry_Contracts/src/Voting.sol +++ b/Foundry_Contracts/src/Voting.sol @@ -46,6 +46,10 @@ modifier electionOngoing() { _; } +receive() external payable { + revert("This contract does not accept Ether"); + } + function addCandidate(string memory _name) public ownerOnly { // Check if a candidate with the same name already exists for (uint i = 0; i < candidates.length; i++) {