commit 4560d9d4b31e8b09956935bf6b796bc8bc7344c1 Author: itsfine Date: Fri Mar 18 15:56:22 2022 +0100 Voting hazi diff --git a/Voting hazi.sol b/Voting hazi.sol new file mode 100644 index 0000000..8284ec0 --- /dev/null +++ b/Voting hazi.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8.11; + +// nem sikerült: sdf + +contract VoteforBest { + uint public NFT; + uint public ERC20; + uint public DAO; + bool public voted; + + address public owner; + + struct Voter{ + bool voted; + address addr; + } + + mapping(address=> Voter ) public voters; + + function Vote (string memory _choice) public { + if (keccak256(abi.encodePacked(_choice)) == keccak256(abi.encodePacked("NFT"))) { + NFT++;} + else if (keccak256(abi.encodePacked(_choice)) == keccak256(abi.encodePacked("DAO"))) { + DAO++;} + else { + require(keccak256(abi.encodePacked(_choice)) == keccak256(abi.encodePacked("ERC20")), 'Please use valid vote option'); + ERC20++; + }} + + +} \ No newline at end of file