Open
Description
Description
Abi decoding SomeStruct[]
fails with
CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables. When compiling inline assembly: Variable headStart is 3 slot(s) too deep inside the stack.K
Strangely, wrapping it in a struct with a SomeStruct
field on it "fixes" the issue
SomeStruct[] memory foo_ = abi.decode(data_, (SomeStruct[]));
fails, as does
struct Foo {
SomeStruct[] bar;
}
but this passes
struct Foo {
SomeStruct bar;
SomeStruct[] baz;
}
The issue only appears with compiler optimizations enabled and appears for both IR and non-IR
Environment
- Compiler version: 0.8.17
- Target EVM version (as per compiler settings):
- Framework/IDE (e.g. Truffle or Remix): hardhat
- EVM execution environment / backend / blockchain client:
- Operating system: