This file contains hidden or 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
| { | |
| "vote.sol": { | |
| "__sources__": { | |
| "vote.sol": { | |
| "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.0;\r\n\r\ncontract Voting {\r\n uint public support;\r\n uint public oppose;\r\n\r\n mapping(address => bool) public hasVoted;\r\n\r\n event VoteCast(address voter, string voteType);\r\n\r\n function voteSupport() public {\r\n require(!hasVoted[msg.sender], \"Already voted\");\r\n support++;\r\n hasVoted[msg.sender] = true;\r\n emit VoteCast(msg.sender, \"SUPPORT\");\r\n }\r\n\r\n function voteOppose() public {\r\n require(!hasVoted[msg.sender], \"Already voted\");\r\n oppose++;\r\n hasVoted[msg.sender] = true;\r\n emit VoteCast(msg.sender, \"OPPOSE\");\r\n }\r\n\r\n function getResults() public view returns (uint, uint) {\r\n return (support, oppose);\r\n }\r\n}", | |
| "file": "vote.sol" | |
| } | |
| } | |
| }, | |
| "Voting.sol": { |