Linked Questions

0 votes
1 answer
341 views

Mint and Create a Struct give me give me error "Stack too deep try removing local variables"

I have an issue with my code, I want to create a function to be able to Mint a token, and add a struct to represent all attributes of this token. The issue is, I have lot's of args on my function (8) ...
Arthur's user avatar
  • 194
4 votes
0 answers
542 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
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
1 answer
56 views

"now"this key word can use.how can i do

pragma solidity >0.4.0 ; pragma experimental ABIEncoderV2; // 代币系统 contract Token { uint tokenTotal; // 代币总和 uint tokenPrice; // 代币价格 uint balanceTokens; // 合约余额 // ...
yao yu's user avatar
  • 11
0 votes
1 answer
904 views

Stack Too Deep Compiling Error on Remix -- Solidity [duplicate]

first off I’d like to say that I’m a noob in Solidity so this issue might sound so trivial, pls bear with me. I’m running into a compiler error on line 61 (Stack too deep). I suppose an easy fix would ...
user96723's user avatar
0 votes
1 answer
39 views

InternalCompilerError: Stack too deep, try using fewer variables [duplicate]

Here is my code // SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; contract GeoSpatialData{ uint public SpatialDataCount = 0; struct GeoData{ uint id; ...
sarangkkl's user avatar
  • 129
0 votes
1 answer
481 views

How do I parse a bytes32 in solidty?

I have a bytes32 object in memory or storage and I want to parse it into little chunks, for example into one uint8, followed by a bool, followed by uint10, followed by address. How can one do that? I ...
Marlo's user avatar
  • 329
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
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
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
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
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
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
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

15 30 50 per page