4.2. Choosing a Solidity Version#
Slang aims to support all Solidity language versions, starting with 0.4.11
, and adding support for all future versions as they are released.
In order to use many of the Slang APIs, you will need to specify the Solidity version that you want to work with. You can see a list of all supported Solidity versions here.
You can also access this list programmatically, by using the LanguageFacts
API:
supported-versions.mts
import assert from "node:assert";
import { LanguageFacts } from "@nomicfoundation/slang/utils";
test("supported versions", () => {
assert.strictEqual(LanguageFacts.allVersions().length, 83);
assert.strictEqual(LanguageFacts.earliestVersion(), "0.4.11");
assert.strictEqual(LanguageFacts.latestVersion(), "0.8.28");
});