Other way to jump the Stack too deep issue.
function _getValues(uint256 tAmount)
private view returns (
uint256 rAmount,
uint256 rTransferAmount,
uint256 rReward,
uint256 tTransferAmount,
uint256 tReward,
uint256 tProject,
uint256 tBurn,
uint256 tCharity
)
{
(
tTransferAmount,
tReward,
tProject,
tCharity,
tBurn
)
= _getTValues(tAmount, tTransferAmount, tReward, tProject, tCharity, tBurn);
(
rAmount,
rTransferAmount,
rReward,
tReward
)
= _getRValuesReward(tAmount, tReward, _getRate());
(
rAmount,
rTransferAmount
)
= _getRValuesProject(rAmount, rTransferAmount, tProject, _getRate());
(
rAmount,
rTransferAmount
)
= _getRValuesBurn(rAmount, rTransferAmount, tBurn, _getRate());
(
rAmount,
rTransferAmount
)
= _getRValuesCharity(rAmount, rTransferAmount, tCharity, _getRate());
return (
rAmount,
rTransferAmount,
rReward,
tTransferAmount,
tReward,
tProject,
tBurn,
tCharity);
}
function _getTValues(
uint256 tAmount,
uint256 tTransferAmount,
uint256 tReward,
uint256 tProject,
uint256 tBurn,
uint256 tCharity
) private view returns (
uint256, uint256, uint256, uint256, uint256) {
tReward = calculateRewardFee(tAmount);
tProject = _getTaxProject(tAmount);
tBurn = calculateBurnFee(tAmount);
tCharity = calculateCharityFee(tAmount);
tTransferAmount = tAmount.sub(tReward).sub(tBurn);
tTransferAmount = tAmount.sub(tCharity).sub(tProject);
return (tTransferAmount, tReward, tProject, tCharity, tBurn);
}
function _getRValuesReward(
uint256 tAmount,
uint256 tReward,
uint256 currentRate)
private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rReward, uint256) {
rAmount = tAmount.mul(currentRate);
rReward = tReward.mul(currentRate);
rTransferAmount = rAmount.sub(rReward);
return (rAmount, rTransferAmount, rReward, tReward);
}
function _getRValuesProject(
uint256 rAmount,
uint256 rTransferAmount,
uint256 tProject,
uint256 currentRate)
private pure returns (uint256, uint256) {
uint256 rProject = tProject.mul(currentRate);
rTransferAmount = rAmount.sub(rProject);
return (rAmount, rTransferAmount);
}
function _getRValuesBurn(
uint256 rAmount,
uint256 rTransferAmount,
uint256 tBurn,
uint256 currentRate)
private pure returns (uint256, uint256) {
uint256 rBurn = tBurn.mul(currentRate);
rTransferAmount = rAmount.sub(rBurn);
return (rAmount, rTransferAmount);
}
function _getRValuesCharity(
uint256 rAmount,
uint256 rTransferAmount,
uint256 tCharity,
uint256 currentRate)
private pure returns (uint256, uint256) {
uint256 rCharity = tCharity.mul(currentRate);
rTransferAmount = rAmount.sub(rCharity);
return (rAmount, rTransferAmount);
}
it doesn’t convince me either