Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LLVM-based Solidity compiler.

matter-labs/solx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solx logo

Optimizing Solidity Compiler

solx is a new optimizing compiler for EVM developed by Matter Labs.

Warning

The project is in beta state 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:

Our mid-term goals:

  • emit ethdebug for optimized code
  • roll out the MLIR codegen to replace Yul and EVM assembly
  • further reduce gas usage and bytecode size
  • eliminate the need for inline assembly for efficiency

Documentation

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:

Installation

For the detailed installation and usage guide, visit the respective page of our documentation.

Architecture

solx consists of three main parts:

  1. solx executable from this repository. The repository also contains parts of the compiler front end: Yul and EVM assembly translators.
  2. era-solidity, an LLVM-friendly fork of the Solidity compiler, that emits Yul and EVM assembly for solx. Despite the repository name, it is not directly related to either ZKsync or ZKsync Era.
  3. era-compiler-llvm, a fork of the LLVM project with an EVM target developed by the solx team.

The most important part of the project is the EVM target in LLVM. You can find its sources here.

Testing

To run the unit and CLI tests, execute cargo test at the repository root.

Troubleshooting

If you have multiple LLVM builds in your system, ensure that you choose the correct one to build the compiler. The environment variable LLVM_SYS_191_PREFIX sets the path to the directory with LLVM build artifacts, which typically ends with target-llvm/build-final. For example:

export LLVM_SYS_191_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.

License

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.

Contact Us

Email us at [email protected] or join our Telegram group.