Radar · Solidity · Archive · Week 37 · Sep 7 – 13, 2026
Misordered Named Parameters in require with Custom Errors Bug
Worth knowingcompiler
- What changed
- The IR‑based code generator now places the arguments of a custom error passed to
requireusing named‑parameter syntax on the stack in call‑site order, rather than the previous call‑site order. - Production impact
- The source does not say.
- Try it
- Write a
requirethat uses a custom error with named parameters and check the order of arguments in the generated bytecode. - Source
- github.com/argotorg/solidity/releases/tag/v0.8.37
Understand it, then run it
Solidity lets you write custom error types to make revert messages cheaper and clearer. When you call require with a custom error and use named parameters, the compiler used to put the arguments on the stack in the order you wrote them. In 0.8.37 the compiler now puts them on the stack in the order the error type declares them, regardless of the order you write them. This means the runtime data that represents the error is always in declaration order, which is what the ABI expects.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed