solx is a new optimizing compiler for EVM developed by Matter Labs and Nomic Foundation.
Warning
The project is in beta and must be used with caution. Please use it only for testing and experimentation. If you want to use it in production, make sure to test your contracts thoroughly, or contact us first.
solx passes multiple test suites, including:
- Foundry projects
- Hardhat projects
- DeFi protocols: UniswapV2, UniswapV3, Mooniswap, StarkEx
- Semantic tests from the solc repository
- Additional tests written by the solx team
solx documentation is powered by GitHub Pages and provided as an mdBook, while its Markdown sources can be found in this directory. To build the book, follow these instructions.
See also:
For the detailed installation and usage guide, visit the respective page of our documentation.
# Compile a Solidity file
solx Contract.sol --bin --abi
# Compile with optimizations
solx Contract.sol --bin --abi -O3
# Output to a directory
solx Contract.sol --bin --abi -o ./buildFor details on the compilation pipeline and components, see the architecture documentation.
For details on running unit tests, integration tests, and project tests, see the testing documentation.
If you are building solx from source and you have multiple LLVM builds in your system, ensure that you choose the correct one to build the compiler.
The environment variable LLVM_SYS_211_PREFIX sets the path to the directory with LLVM build artifacts, which typically ends with target-llvm/build-final.
For example:
export LLVM_SYS_211_PREFIX="${HOME}/src/solx/target-llvm/build-final"If you suspect that the compiler is not using the correct LLVM build, check by running set | grep LLVM, and reset all LLVM-related environment variables.
For reference, see llvm-sys and Local LLVM Configuration Guide.
- Crate solx is licensed under GNU General Public License v3.0
- All other crates are licensed under the terms of either
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
solx-solidityis licensed under GNU General Public License v3.0solx-llvmis licensed under the terms of Apache License, Version 2.0 with LLVM Exceptions, (LICENSE or https://llvm.org/LICENSE.txt)
Additionally, this repository vendors tests and test projects that preserve their original licenses:
These projects are modified for the purposes of testing our compiler toolchain and are not used outside of this repository.
Visit the project directories to discover the terms of each license in detail. These and other projects are licensed in either per-file or per-project manner.
Email us at alex@nomic.foundation or join our Telegram group.
