{
    "Function": "_vote",
    "File": "contracts/contracts/Voter.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IVotingEscrow",
        "IVotingEscrow",
        "IGauge",
        "IVotingEscrow"
    ],
    "Internal Calls": [
        "require(bool)",
        "_reset",
        "require(bool)",
        "_updateFor"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _vote(uint _tokenId, address[] memory _poolVote, uint256[] memory _weights) internal {\n        _reset(_tokenId);\n        uint _poolCnt = _poolVote.length;\n        uint256 _weight = IVotingEscrow(_ve).balanceOfNFT(_tokenId);\n        uint256 _totalVoteWeight = 0;\n        uint256 _totalWeight = 0;\n        uint256 _usedWeight = 0;\n\n        for (uint i = 0; i < _poolCnt; i++) {\n            _totalVoteWeight += _weights[i];\n        }\n\n        for (uint i = 0; i < _poolCnt; i++) {\n            address _pool = _poolVote[i];\n            address _gauge = gauges[_pool];\n\n            if (isGauge[_gauge]) {\n                uint256 _poolWeight = _weights[i] * _weight / _totalVoteWeight;\n                require(votes[_tokenId][_pool] == 0);\n                require(_poolWeight != 0);\n                _updateFor(_gauge);\n\n                poolVote[_tokenId].push(_pool);\n\n                weights[_pool] += _poolWeight;\n                votes[_tokenId][_pool] += _poolWeight;\n                _usedWeight += _poolWeight;\n                _totalWeight += _poolWeight;\n                IGauge(gauges[_pool]).setVoteStatus(IVotingEscrow(_ve).ownerOf(_tokenId), true);\n                emit Voted(msg.sender, _tokenId, _poolWeight);\n            }\n        }\n        if (_usedWeight > 0) IVotingEscrow(_ve).voting(_tokenId);\n        totalWeight += uint256(_totalWeight);\n        usedWeights[_tokenId] = uint256(_usedWeight);\n    }"
}