Linked Questions

1 vote
0 answers

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
0 answers

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

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

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

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
321 votes
9 answers

`external` vs `public` best practices

Apart from the public modifier Ethereum introduces the external one. Both may be called outside of the contract and inside (the later one by this.f() pattern). Moreover, according to the docs: ...
Jakub Wojciechowski's user avatar
7 votes
3 answers

Function with more than 16 arguments

At some point in my contract I have a public, not Constant function that has more than 16 arguments (24 to be exact). I'm getting an error saying Stack too deep. Try removing local variables I can't ...
Anthony Silva's user avatar
7 votes
1 answer

Stack too deep when compiling inline assembly

I'm running into a YulException: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack. using a smart contract that has this function. I took this ...
João Quintanilha's user avatar
1 vote
2 answers

public struct showing stack overflow error

I'm trying to add more then 9 data in public struct it's showing me below error Internal compiler error: Stack too deep, try removing local variables. if I remove the public keyword from User ...
comeback4you's user avatar
0 votes
4 answers

How many variables/ rows can contracts handle?

From the article: Are there well-solved and simple storage patterns for Solidity? Ignoring costs, does anyone know how many variables/rows a solidity contract using each of the types can handle? ...
thefett's user avatar
  • 3,873
0 votes
1 answer

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
4 votes
0 answers

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
1 answer

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
3 votes
1 answer

Structure with 16 elements

I have created structure with 16 elements and received solidity compiler error. Exception during compilation: /src/libsolidity/../libevmasm/Instruction.h(217): Throw in function dev::solidity::...
Bogdan's user avatar
  • 397
0 votes
1 answer

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

15 30 50 per page