vote1 (BlockChain) Solidity를 이용한 투표 DApp 구현 express/contracts내 Vote.sol 파일 작성 // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; contract Vote { string[] public candidateList; mapping(string => uint) public votesReceived; event Voted(string candidate, uint votes); constructor(string[] memory _candidateNames) { candidateList = _candidateNames; } function validCandidate(string memory candidate) private view returns (bool) { for (uint .. 2023. 3. 8. 이전 1 다음