DEV Community

coderbang1
coderbang1

Posted on

Stack too deep, try removing local variables

while compiling in remix i get the above error:

CompilerError: Stack too deep, try removing local variables.

(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, tCharity, tMarketing, _getRate());

here is the code part

function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) {

`(uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tCharity , uint256 tMarketing) = _getTValues(tAmount);`

`(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, tCharity, tMarketing, _getRate());`

`return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity, tCharity, tMarketing);
Enter fullscreen mode Exit fullscreen mode

} `

Top comments (0)