singleLegLength是数组长度。
function votingBegins() public {
//时间戳,用1970年到现在的秒
require(admin == msg.sender, "Admin what?");
willVotingBegin = true;
endOfVotingTimestamp = block.timestamp + 2592000000; //投票期限一个月
totalVotingAgreeWeight = 0;
totalVotingWeight = 0;
for (uint256 i = 0; i < singleLegLength; i++) {
voters[singleLeg[i]].weight = users[singleLeg[i]].amount;
voters[singleLeg[i]].voted = false;
voters[singleLeg[i]].agreeOrNot = false;
}
}