```\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    \_updateOnTransfer(params, mooniswapFactoryGovernance.defaultFee, \_emitFeeVoteUpdate, \_fee);\n    \_updateOnTransfer(params, mooniswapFactoryGovernance.defaultSlippageFee, \_emitSlippageFeeVoteUpdate, \_slippageFee);\n    \_updateOnTransfer(params, mooniswapFactoryGovernance.defaultDecayPeriod, \_emitDecayPeriodVoteUpdate, \_decayPeriod);\n}\n```\n