Duplicate math operations can be cached to reduce gas usage, e.g. no need to calculate updatedFee / 2 twice here:
operationShare += updatedFee / 2;
veCRVShare += updatedFee / 2;
or here:
mochi.transfer(msg.sender, _amount / 2);
mochi.transfer(address(vMochi), _amount / 2);
Handle
pauliax
Vulnerability details
Impact
Duplicate math operations can be cached to reduce gas usage, e.g. no need to calculate updatedFee / 2 twice here: operationShare += updatedFee / 2; veCRVShare += updatedFee / 2;
or here: mochi.transfer(msg.sender, _amount / 2); mochi.transfer(address(vMochi), _amount / 2);
Recommended Mitigation Steps
Eliminate useless duplicate calculations.