The protocol might transfer extra SATIN emissions to veSatin holders potentially making SatinVoter.sol insolvent
The function `_distribute()` in SatinVoter.sol is generally responsible for distributing weekly emissions to a gauge based on the percentage of total votes the associated pool received. In particular, it's called by `updatePeriod()` (as per fix TRST-H-4) on the gauge associated with the Satin / $CASH pool. The variable veShare is set to be equal to the returned value of `calculateSatinCashLPVeShare()`, which is calculated as the percentage of Satin / $CASH LP times claimable[gauge] and represents the amount of SATIN that will be transferred to VeDist.sol when checkpointing emissions in checkpointEmissions():\\n```\\n      uint _claimable = claimable[_gauge];\\n      if (SATIN_CASH_LP_GAUGE == _gauge) {\\n            veShare = calculateSatinCashLPVeShare(_claimable);\\n      _claimable -= veShare;\\n      }\\n      if (_claimable > IMultiRewardsPool(_gauge).left(token) && _claimable / DURATION > 0) {\\n          claimable[_gauge] = 0;\\n      if (is4poolGauge[_gauge]) {\\n              IGauge(_gauge).notifyRewardAmount(token, _claimable, true);\\n      } else {\\n                IGauge(_gauge).notifyRewardAmount(token, _claimable, false);\\n           }\\n      emit DistributeReward(msg.sender, _gauge, _claimable);\\n        }\\n```\\n\\nHowever, when the if condition (_claimable > IMultiRewardsPool(_gauge).left(token) && _claimable / DURATION > 0) is false the variable claimable[_gauge] will not be set to 0, meaning the next time veShare will be calculated it will include emissions that have already been distributed, potentially making SatinVoter.sol insolvent
Adjust claimable[gauge] after calculating veShare and calculate veShare only if the msg.sender is SatinMinter.sol to prevent potential attackers from manipulating the value by repeatedly calling _distribute():\\n```\\n    if (SATIN_CASH_LP_GAUGE == _gauge && msg.sender == minter) {\\n        veShare = calculateSatinCashLPVeShare(_claimable);\\n           claimable[_gauge] -= veShare;\\n              _claimable -= veShare;\\n        }\\n```\\n
```\\n      uint _claimable = claimable[_gauge];\\n      if (SATIN_CASH_LP_GAUGE == _gauge) {\\n            veShare = calculateSatinCashLPVeShare(_claimable);\\n      _claimable -= veShare;\\n      }\\n      if (_claimable > IMultiRewardsPool(_gauge).left(token) && _claimable / DURATION > 0) {\\n          claimable[_gauge] = 0;\\n      if (is4poolGauge[_gauge]) {\\n              IGauge(_gauge).notifyRewardAmount(token, _claimable, true);\\n      } else {\\n                IGauge(_gauge).notifyRewardAmount(token, _claimable, false);\\n           }\\n      emit DistributeReward(msg.sender, _gauge, _claimable);\\n        }\\n```\\n