Stack too deep, Why?

You have too many local variables. Try this:

function _getTValues(uint256 tAmount) private view returns (uint256 tTransferAmount, uint256 tHODLFree, uint256 tCharity, uint256 tBurn, uint256 tMarketing, uint256 tProject) {
	    
		tHODLrFee = calculateRewardFee(tAmount);
		
		(tCharity, tBurn, tMarketing, tProject) = _getTaxBreakdown(tAmount);
		tTransferAmount = tAmount.sub(tHODLrFee).sub(tBurn).sub(tProject);
		 tTransferAmount = tAmount.sub(tMarketing).sub(tCharity);

		return (tTransferAmount, tHODLrFee, tCharity, tBurn, tMarketing, tProject);
	}

1 Like