MooniswapGovernance - votingpower is not accurately reflected when minting pool tokens Unverified
When a user provides liquidity to the pool, pool-tokens are minted. The minting event triggers the `_beforeTokenTransfer` callback in `MooniswapGovernance` which updates voting power reflecting the newly minted stake for the user.\\nThere seems to be a copy-paste error in the way `balanceTo` is determined that sets `balanceTo` to zero if new token were minted (from==address(0)). This means, that in a later call to `_updateOnTransfer` only the newly minted amount is considered when adjusting voting power.\\nIf tokens are newly minted `from==address(0)` and therefore `balanceTo -> 0`.\\n```\\nfunction \\_beforeTokenTransfer(address from, address to, uint256 amount) internal override {\\n    uint256 balanceFrom = (from != address(0)) ? balanceOf(from) : 0;\\n    uint256 balanceTo = (from != address(0)) ? balanceOf(to) : 0;\\n    uint256 newTotalSupply = totalSupply()\\n        .add(from == address(0) ? amount : 0)\\n        .sub(to == address(0) ? amount : 0);\\n\\n    ParamsHelper memory params = ParamsHelper({\\n        from: from,\\n        to: to,\\n        amount: amount,\\n        balanceFrom: balanceFrom,\\n        balanceTo: balanceTo,\\n        newTotalSupply: newTotalSupply\\n    });\\n```\\n\\nnow, `balanceTo` is zero which would adjust voting power to `amount` instead of the user's actual balance + the newly minted token.\\n```\\nif (params.to != address(0)) {\\n    votingData.updateBalance(params.to, voteTo, params.balanceTo, params.balanceTo.add(params.amount), params.newTotalSupply, defaultValue, emitEvent);\\n}\\n```\\n
`balanceTo` should be zero when burning (to == address(0)) and `balanceOf(to)` when minting.\\ne.g. like this:\\n```\\nuint256 balanceTo = (to != address(0)) ? balanceOf(to) : 0;\\n```\\n
```\\nfunction \\_beforeTokenTransfer(address from, address to, uint256 amount) internal override {\\n    uint256 balanceFrom = (from != address(0)) ? balanceOf(from) : 0;\\n    uint256 balanceTo = (from != address(0)) ? balanceOf(to) : 0;\\n    uint256 newTotalSupply = totalSupply()\\n        .add(from == address(0) ? amount : 0)\\n        .sub(to == address(0) ? amount : 0);\\n\\n    ParamsHelper memory params = ParamsHelper({\\n        from: from,\\n        to: to,\\n        amount: amount,\\n        balanceFrom: balanceFrom,\\n        balanceTo: balanceTo,\\n        newTotalSupply: newTotalSupply\\n    });\\n```\\n