<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp" -->

---
title: Misordered Named Parameters in require with Custom...
description: A compiler bug in Solidity's IR-based code generator, introduced in version 0.8.26, could misorder arguments encoded into revert data when a custom error is...
canonical: https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Misordered Named Parameters in require with Custom Errors Bug | daily.dev
og:description: A compiler bug in Solidity's IR-based code generator, introduced in version 0.8.26, could misorder arguments encoded into revert data when a custom error is...
og:url: https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp
og:image: https://api.daily.dev/og/posts/0qT7XUCKp.png
og:image:alt: Misordered Named Parameters in require with Custom Errors Bug
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Misordered Named Parameters in require with Custom Errors Bug

**[Solidity](https://daily.dev/sources/solidity)** · 8 min read · 0 upvotes · 0 comments

## Summary

A compiler bug in Solidity's IR-based code generator, introduced in version 0.8.26, could misorder arguments encoded into revert data when a custom error is passed to require() using named parameters in a non-declaration order. The bug pushed arguments in call-site order rather than declaration order before ABI encoding, causing swapped or type-confused values, and in some cases misaligned stack slots that either aborted with an undecoded revert or produced a plausible-looking but incorrect payload. The issue was reported via the Ethereum Foundation bug bounty by a researcher at Spearbit and rated 'very low' severity since it only affects revert data for transactions already reverting, requires an uncommon coding pattern, and has no viable exploitation path. Solidity 0.8.37 fixes the bug; developers are advised to upgrade or, in the meantime, avoid non-declaration-order named arguments or use positional arguments. Standards like ERC-3668 that rely on decoding custom error revert data are called out as a scenario where this could cause real breakage.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://soliditylang.org/blog/2026/09/10/misordered-named-parameters-in-require-with-custom-errors-bug>

## Questions this post answers

### What is the misordered named parameters bug in Solidity's require with custom errors?

A bug in Solidity's IR-based code generator, present from version 0.8.26, pushed named-argument custom error parameters onto the stack in call-site order instead of declaration order before ABI encoding. This caused require(condition, ErrorName({...})) calls with reordered named arguments to produce revert data with swapped or misaligned values. It was fixed in Solidity 0.8.37 and rated very low severity since only already-reverting transactions are affected.

_Track compiler fixes like this on daily.dev before shipping IR-compiled contracts with custom errors._

### Which Solidity contracts are affected by the require named custom error argument bug?

A contract is affected only when compiled with the IR-based pipeline (--via-ir or viaIR: true), uses require(condition, ErrorName({...})) with a user-defined error, has at least two arguments in an order differing from the declaration, and at least one reordered argument is not a string literal. Standard evmasm compilation and standalone revert ErrorName({...}) statements are not affected.

_Developers auditing custom error usage can follow compiler advisories like this via daily.dev._

### How do I avoid the Solidity IR pipeline bug with named arguments in custom errors before upgrading?

Write named arguments in the same order as the error's declaration, or use positional arguments instead of named ones, until upgrading to Solidity 0.8.37 or later. The bug only triggers when named arguments are supplied out of declaration order in a require() call using a custom error compiled via the IR pipeline.

_daily.dev helps developers stay ahead of compiler quirks like this while migrating Solidity versions._

## Similar posts on daily.dev

- [Solidity 0.8.37 Release Announcement](https://daily.dev/posts/solidity-0-8-37-release-announcement-h2wcdrdlt) · Solidity · 1 upvotes · 0 comments
- [Spill Slot Collision Across Mutual Recursion Bug](https://daily.dev/posts/spill-slot-collision-across-mutual-recursion-bug-3sfkwn334) · Solidity · 0 upvotes · 0 comments
- [Inheritance Order Reversal On Storage End Warning Bug](https://daily.dev/posts/inheritance-order-reversal-on-storage-end-warning-bug-yyhipzkyq) · Solidity · 0 upvotes · 0 comments
- [Designing Blockchain Systems: What Smart Contract Tutorials Don’t Tell You \(Part 2\)](https://daily.dev/posts/designing-blockchain-systems-what-smart-contract-tutorials-don-t-tell-you-part-2--flggbflgg) · Coins Bench · 1 upvotes · 0 comments
- [Bug Detection Blind Spots in AI Coding Harnesses \(GStack and Beyond\)](https://daily.dev/posts/bug-detection-blind-spots-in-ai-coding-harnesses-gstack-and-beyond--5k8lonjtf) · Towards Data Science · 0 upvotes · 0 comments

---

Tags: [#ethereum](https://daily.dev/tags/ethereum), [#smart-contracts](https://daily.dev/tags/smart-contracts), [#solidity](https://daily.dev/tags/solidity)

[View this post on daily.dev](https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Misordered Named Parameters in require with Custom Errors Bug","url":"https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp"},"datePublished":"2026-09-10T14:24:22.454Z","dateModified":"2026-10-15T02:22:34.814Z","description":"A compiler bug in Solidity's IR-based code generator, introduced in version 0.8.26, could misorder arguments encoded into revert data when a custom error is...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c07b4565a31c98ea4fd5ac734647507c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c07b4565a31c98ea4fd5ac734647507c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Solidity","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Solidity","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ba7e7fc77c4e441aa2432e9e8cabeb0f","url":"https://daily.dev/sources/solidity"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ethereum,smart-contracts,solidity","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Solidity","item":"https://daily.dev/sources/solidity"},{"@type":"ListItem","position":3,"name":"Misordered Named Parameters in require with Custom Errors Bug"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/misordered-named-parameters-in-require-with-custom-errors-bug-0qt7xuckp#faq","mainEntity":[{"@type":"Question","name":"What is the misordered named parameters bug in Solidity's require with custom errors?","acceptedAnswer":{"@type":"Answer","text":"A bug in Solidity's IR-based code generator, present from version 0.8.26, pushed named-argument custom error parameters onto the stack in call-site order instead of declaration order before ABI encoding. This caused require(condition, ErrorName({...})) calls with reordered named arguments to produce revert data with swapped or misaligned values. It was fixed in Solidity 0.8.37 and rated very low severity since only already-reverting transactions are affected. Track compiler fixes like this on daily.dev before shipping IR-compiled contracts with custom errors."}},{"@type":"Question","name":"Which Solidity contracts are affected by the require named custom error argument bug?","acceptedAnswer":{"@type":"Answer","text":"A contract is affected only when compiled with the IR-based pipeline (--via-ir or viaIR: true), uses require(condition, ErrorName({...})) with a user-defined error, has at least two arguments in an order differing from the declaration, and at least one reordered argument is not a string literal. Standard evmasm compilation and standalone revert ErrorName({...}) statements are not affected. Developers auditing custom error usage can follow compiler advisories like this via daily.dev."}},{"@type":"Question","name":"How do I avoid the Solidity IR pipeline bug with named arguments in custom errors before upgrading?","acceptedAnswer":{"@type":"Answer","text":"Write named arguments in the same order as the error's declaration, or use positional arguments instead of named ones, until upgrading to Solidity 0.8.37 or later. The bug only triggers when named arguments are supplied out of declaration order in a require() call using a custom error compiled via the IR pipeline. daily.dev helps developers stay ahead of compiler quirks like this while migrating Solidity versions."}}]}
```

