You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hardhat-slang: add initial support for the new slang compiler on a similar pattern as hardhat-slang-solx - #8658
This PR adds initial support for the new slang compiler by following the previous hardhat-slang-solx plugin added in #8034.
The PR reuses the core hardhat swappable compiler type support added in #8008 and #8009.
hardhat-slang adds slang as a compiler type, and follows the same pattern of requiring adding a slang build profile to hardhat.config.ts.
Note that the compiler version is now decoupled from the Solidity language version, so the plugin configuration pins the slang version to download in slang.version , whereas the build profile specifies which solidity versions to be compiled with slang (currently, we aren't passing the Solidity version to slang, and compiler 0.8.x version support is not ready, see limitations). Same EVM versions supported as the previous hardhat-slang-solx.
Current limitations (will be addressed in follow-up PRs):
tested by successfully building real repositories (such as OpenZeppelin) however, current pre-release slang version used here does not output ABI or DWARF, so the end-to-end compiler tests in the EDR repo are not yet passing (support will be added in a next PR).
running hardhat test --build-profile slang will fail because EDR rejects build info without ABI.
Releases mirror is not yet set up, so the current setup uses the github releases page directly, will be updated in a future PR.
the compiler pre-release binary used in this PR currently builds everything as 0.8.37.
The solidity version will need to be passed to the slang binary when compiling (future PR).
EDR will require updates to support slang compiler type
EDR will need to parse DWARF traces / slang traces instead of solc AST to reconstruct stack traces etc.
compiler pre-release version used here also doesn't output metadata, which is also required by hardhat.
only verified on linux x64 for now, no MacOS, Arm, or Windows tests yet.
No changeset included as this plugin is not release-ready yet.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Adds the experimental @nomicfoundation/hardhat-slang plugin, modeled after hardhat-slang-solx, to integrate the new Slang compiler pipeline with Hardhat 3.
Changes:
Adds Slang configuration, compiler hooks, release validation, and output augmentation.
Implements verified compiler downloads and platform-specific asset selection.
Adds plugin documentation, errors, fixtures, and comprehensive tests.
As a heads up I'm adding --solidity-version <version> and settings.solidityVersion in NomicFoundation/solx#787.
Claude comment
NomicFoundation/solx#787 takes the Solidity version from settings.solidityVersion in standard JSON mode and rejects --solidity-version next to --standard-json, the same way it handles --evm-version. Could augmentIfSlang set solidityVersion: entry.version alongside the optimizer and debug-info defaults instead? Then it's in the solcInput, so the build info reproduces the compile on its own, and targetVersionFlag/targetSolidityVersion can go.
We don't mark the package as private (this is to allow local testing via
verdaccio). However, we do exclude it from release in the publish
scripts.
The release builds its publish list from a pnpm publish dry run, so
excluding the package there keeps it out of every later step. The local
command for regenerating that list gets the same exclusion.
This crude filter will be reverted, likely when we merge `hardhat-slang`
into core as a built-in plugin.
This config hook statically imports slang-compiler.ts, which in turn imports hardhat/internal/solidity and its compiler-execution dependencies. Config hook factories run on every Hardhat invocation, so commands that never compile still pay this startup cost. Move the output-selection constants/helper into a lightweight module that does not import the compiler runner, and import that module here.
A custom-path compiler is driven with metadata selected from the global pin rather than from the custom binary whose version was just parsed. Once releases have different CLI protocols (for example, a newer release with targetVersionFlag), pinning an older downloadable release while using a newer custom binary sends the older release's arguments and can compile the wrong Solidity target or be rejected. Select protocol metadata using customSlangVersion when known, and define an explicit fallback for unknown/nightly versions instead of letting slang.version control the custom binary.
…file
main moved prettier to 3.9.9, so merging it left the lockfile pointing
hardhat-slang at a 3.9.8 entry that no longer exists. The lockfile is
regenerated from main's, which also drops @typescript-eslint 8.70.0
entries nothing references.
The reason will be displayed to describe this comment to others. Learn more.
I have added an exclusion to our release scripts to avoid hardhat-slang, it has no npm package currently even if this exclusion was to fail.
I think we merge the plugin now, and continue with follow on PRs.
marianfe
changed the title
WIP: hardhat-slang: add support for the new slang compiler by following the hardhat-slang-solx template.
hardhat-slang: add initial support for the new slang compiler by following the hardhat-slang-solx as a template.
Oct 14, 2026
marianfe
changed the title
hardhat-slang: add initial support for the new slang compiler by following the hardhat-slang-solx as a template.
hardhat-slang: add initial support for the new slang compiler by following the hardhat-slang-solx as a template
Oct 14, 2026
marianfe
changed the title
hardhat-slang: add initial support for the new slang compiler by following the hardhat-slang-solx as a template
hardhat-slang: add initial support for the new slang compiler on a similar pattern as hardhat-slang-solx
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds initial support for the new slang compiler by following the previous hardhat-slang-solx plugin added in #8034.
The PR reuses the core hardhat swappable compiler type support added in #8008 and #8009.
hardhat-slang adds
slangas a compiler type, and follows the same pattern of requiring adding aslangbuild profile tohardhat.config.ts.Note that the compiler version is now decoupled from the Solidity language version, so the plugin configuration pins the slang version to download in
slang.version, whereas the build profile specifies which solidity versions to be compiled withslang(currently, we aren't passing the Solidity version to slang, and compiler 0.8.x version support is not ready, see limitations). Same EVM versions supported as the previous hardhat-slang-solx.Current limitations (will be addressed in follow-up PRs):
running
hardhat test --build-profile slangwill fail because EDR rejects build info without ABI.slangcompiler typeNo changeset included as this plugin is not release-ready yet.