Skip to content
🎉 Welcome to the new Aptos Docs! Click here to submit feedback!

Move On Aptos Compiler

The Move on Aptos compiler (codename ‘compiler v2’) is a new tool which translates Move source code into Move bytecode. It unifies the architectures of the Move compiler and the Move Prover, enabling faster innovation in the Move language. It also offers new tools for defining code optimizations which can be leveraged to generate more gas efficient code for Move programs.

The new compiler supports Move 2, the latest revision of the Move language. Head over to the release page in the book to learn more about the new features in Move 2. You can select both this language version and the new compiler by using aptos move compile --move-2.

Compiler v2 Release State

Compiler v2 is ready for production but not yet the default. You opt in to use compiler v2 and language Move 2 by using the --move-2 flag passed to the Aptos CLI.

Bug Bounty

We award a bounty for each unique semantic bug identified in the compiler. Bugs need to surface as a difference of execution outcome of the v1 and v2 compilers, as demonstrated by a Move unit test. Try your existing Move tests with the new compiler, it is as easy as calling aptos move test --compiler-version=2 --language-version=1! Not all differences in the compiler behavior count for the program, head over here for details of the bounty program. Even if a difference in behavior does not qualify for a bounty, we encourage you to open an issue using the link below.

Reporting an Issue

If you run into issues, please use this link to create a github issue. If you are able to provide a small piece of Move code which reproduces the issue, debugging and fixing it will be easier for us.

Using Compiler v2

Ensure to have installed the latest version of the Aptos CLI:

Terminal
aptos update aptos # on supported OS
brew upgrade aptos # on MacOS

To run compiler v2 and Move 2, pass the flag --move-2 to the Aptos CLI. Examples:

Terminal
aptos move compile --move-2
aptos move test --move-2
aptos move prove --move-2