Skip to main content
Share Your Experience: Take the 2024 Developer Survey
4 votes

Stack too deep error in Solidity v0.8.4, no error / debug info from compiler

Turns out the issue was a struct to which I had added a few fields, and there were 16 fields in the struct, and that too is not permissible. Re-organizing, moving some fields to another struct, and ...
tinker's user avatar
  • 161
4 votes

Why is the subcall gas limit set to 63/64th of the remaining gas?

There is link describing how 63/64 rule allowed to execute transaction but to waste a lot of gas instead of just failing: https://github.com/Synthetixio/synthetix/issues/243
k06a's user avatar
  • 3,036
4 votes
Accepted

Solidity modifiers: good or bad?

I often find I want a software client to be able to check but I also want a modifier for readability, so it often ends up like this: modifier onlyIfAllowed() { require(isAllowed(args)); _; } ...
Rob Hitchens's user avatar
  • 55.3k
3 votes

Solidity modifiers: good or bad?

Since modifiers don't increase overall gas cost, plus they improve code readability, I prefer to use them. It's a really cool and useful solidity feature.
abed's user avatar
  • 664
3 votes

Stack too deep problem

The number of variables you are allowed to use is limited. I encountered this error a lot of times in the past. It is very frustrating. However, there is no good solution to this problem. You have ...
cqx's user avatar
  • 3,462
3 votes
Accepted

Are there any EVM opcodes that assume a variable number of stack inputs?

As of 2023-10-01 all opcodes take a fixed number of stack inputs. https://ethereum.org/en/developers/docs/evm/opcodes/ Some opcodes, like call, accept an arbitrary amount of data, but they receive the ...
Ismael's user avatar
  • 30.5k
2 votes

solidity 1024 call stack depth

I think it's better to see it that way : There is only one call depth limit during a transaction execution, currently set at 1024 as you can see here. This is not a stack as in stack memory space, ...
hroussille's user avatar
  • 7,721
2 votes
Accepted

How does the EVM stack behave between calls to remote contracts

Stack and memory are part of the call. Every call has its own stack and memory, which start from empty. So, using your words, stack and memory belong to the EVM, not to the contract. If you have a ...
0xSanson's user avatar
  • 3,249
2 votes

I want to know a Contract address verified or not by programatically

Contract "verification" is not a blockchain concept. It's just a concept invented by blockchain explorers - there is no 'universal' verification, it's always per-service. Verification ...
Lauri Peltonen's user avatar
2 votes
Accepted

How does opcode JUMP work in the EVM?

Yes, The JUMP instruction uses a value from the stack and alters the program counter, thus breaking the linear path of the execution to another point in the deployed code. The value of the counter in ...
Alexey Smirnov's user avatar
1 vote

How does the stack multiply a 32 byte number with a 1 byte number?

That is precisely because you have only 32 bytes, and the EVM manages overflows, removing the most significant bits in the result. The multiply operation is just an add operation you do multiple times....
Giuseppe Bertone's user avatar
1 vote

Stack too deep, when compiling inline assembly Variable headStart

Could you share your code? With a quick search on google, I found this article that may help you. Copying from the article: The reason is a limitation in how variables can be referenced in the EVM ...
Wuzhong - Chainstack DevEx's user avatar
1 vote
Accepted

How to call another function in solidity that has a struct for a parameter of over 16 variables?

You wouldn't be able set the variable in storage, even the whole struct as a variable, you'd have to set individual subsets of the variables into storage. This way they can be popped off the stack.
Patrick Collins's user avatar
1 vote
Accepted

Does solidity support varargs arguments?

Solidity currently does not support defining varargs as an input parameter for a function or modifier. However, there is a way to add anonymous params (e.g. with no name).
Yongjian P.'s user avatar
  • 4,200
1 vote

Does solidity support varargs arguments?

In Solidty, codes convert to EVM bytecode in two different ways: directly from solidity code to EVM opcode ("old codegen") or intermediate representation (“IR”) in Yul (“new codegen”), if ...
Payam Safaei's user avatar
1 vote

How does the EVM read values in the Stack?

The Stack is implemented as part of the client. So let’s say we consider Geth (the most popular client). In this case, the Stack is simply represented as a list behind the scenes. Literally just a ...
Jesper - jtk.eth's user avatar
1 vote
Accepted

EVM are stack and memory part of the EVM context

You can find the answer in another question: Does stack persist through external calls? The recipient contract doesn't have access to the caller contract's stack. There are two separate stacks: a ...
Giuseppe Bertone's user avatar
1 vote

Can't find memory field in structLogs field in debug_traceTransaction RPC Call

In your RPC request, you are specifying disableMemory: false. However, according to these docs https://geth.ethereum.org/docs/rpc/ns-debug#debug_tracetransaction, the option key is enableMemory and ...
antazoey's user avatar
1 vote

failed require() causes RangeError: Maximum call stack size exceeded

Try rolling back ethers to 5.6.1 There's a known compatibility issue with Hardhat/ethers.js on parsing revert data. See discussion here for context: https://github.com/ethers-io/ethers.js/discussions/...
devinaconley's user avatar
1 vote

CompilerError: Stack too deep, try removing local variables

EVM cannot process lots of data at once. So if you are trying to return bulk of data you shouldn,t. Any way if you want to return arrays from a function you can use pragma expermental ABIEncoderV2
MYANZIK shrestha's user avatar
1 vote

Where does contract’s call failure behavior is definied in the yellow paper?

The fact that a 0x0 is pushed to the stack on a failed call and 0x1 for a successful call is specified under the description of CALL on page 35 of the yellowpaper. To answer your second question, no, ...
natewelch_'s user avatar
  • 12.1k
1 vote
Accepted

Is it possible to disable "Stack too deep" errors while in development?

No. The stack is part of the EVM specification and you can't change it. Hope it helps.
Rob Hitchens's user avatar
  • 55.3k

Only top scored, non community-wiki answers of a minimum length are eligible