Linked Questions

0 votes
1 answer
1k views

CompilerError: Stack too deep, try removing local variables. How to solve the problem? [duplicate]

I'm having problems with this part of the code. Can you tell me how to solve this problem? I have read various documentation, but maybe someone knows the solution function _getValues(uint256 tAmount)...
Dmitry's user avatar
  • 1
0 votes
1 answer
62 views

Stack too deep error - need help fixing it! [duplicate]

I keep getting the 'stack too deep' error on solidity. I was wondering if anyone can help me fix this with in following code: function _getTValues(uint256 tAmount) private view returns (uint256, ...
GandalfTheGrey's user avatar
0 votes
1 answer
38 views

Stack too deep error [duplicate]

Not sure what the best approach is to get around this. New to solidity. I've read the complicated 'answers' to this that suggest using structs, arrays, etc. but I can't figure out how to address this. ...
Ash's user avatar
  • 1
0 votes
1 answer
1k views

Convert bytes to uint256[]

I am writing an implementation of ERC777TokensRecipient. So that means a function function tokensReceived(address operator, address from, address to, uint256 amount, bytes data, bytes operatorData) ...
Maarten Dhondt's user avatar
0 votes
1 answer
1k views

Getting this ---- Error: Stack too deep, try removing local variables [duplicate]

Hi Ethereum Developer's, Need your precious time.. I know this question is asked and solutions is given for the same I have a smart contract--------- pragma solidity ^0.4.18; contract myContract ...
Muddassar Shaikh's user avatar
4 votes
0 answers
562 views

Block scoping in Solidity to avoid "Stack too deep error"

I have a quite big function with 16+ local variables which produces the infamous Stack too deep error. To handle this bad boy I have searched for the possible solutions and ended up using scopes. ...
rihekopo's user avatar
  • 316
2 votes
0 answers
1k views

Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack [duplicate]

I tried to add another parameter to my constructor and I get the following error when compiling with hardtest to test. If I remove one parameter it compiles again, so clearly it's related to the ...
Tom's user avatar
  • 123
1 vote
0 answers
15 views

Stack too deep error when trying to calculate two charity fees [duplicate]

How can I fix the below functions? I'm getting CompilerError: Stack too deep, try removing local variables. (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee,...
William's user avatar
  • 113
1 vote
0 answers
30 views

Stack too deep, try removing local variables. _tOwned[sender] = _tOwned[sender].sub(tAmount); [duplicate]

I need help, i don't understand this Error... Code: function _transferFromExcluded(address sender, address recipient, uint256 tAmount, bool lottery, bool updateWinner) private { uint256 ...
Raphael Cibulka's user avatar
1 vote
0 answers
23 views

Error while compiling a function [duplicate]

Below function is showing error while compilation that "stack is too deep, try removing local variables mapping (address => mapping (uint => Exam)) public exams; function getExamQuestion( ...
Suman Raj's user avatar
1 vote
0 answers
108 views

Error on contract constructor - CompilerError: Stack too deep, try removing local variables [duplicate]

I have the following constructor on a contract: constructor( string name, string symbol, uint8 tokenResolution, string defaultUnderlying, uint maturityTimestamp, uint rate, ...
Lucas Yamamoto's user avatar
0 votes
0 answers
38 views

CompilingError: Stack too deep, try removing local variables [duplicate]

I have a function that lists an NFT on a marketplace for sale. In the process, it keeps records by saving data in a struct inside nested maps represented by the NFT address and token ID. I am running ...
Weivy's user avatar
  • 1
0 votes
0 answers
25 views

Stack too deep, try removing local variables when using remix [duplicate]

while compiling in remix i get the above error: CompilerError: Stack too deep, try removing local variables. --> work/youkie.sol:1015:80: | 1015 | (uint256 rAmount, uint256 ...
stofu's user avatar
  • 93
0 votes
0 answers
24 views

CompilerError: Stack too deep, try removing local variables. - [duplicate]

i am trying to compile my contract and running into this issue: CompilerError: Stack too deep, try removing local variables. I am not really sure how to fix it. Below is my code that is throwing the ...
AndG's user avatar
  • 1
0 votes
0 answers
41 views

How to fix CompilerError: Stack too deep, try using fewer variables? [duplicate]

When attempting to compile the following contract I am receiving the following error: InternalCompilerError: Stack too deep, try using fewer variables. How can I fix this?I want the getPerson function ...
Jaylukmann's user avatar

15 30 50 per page