WAX-CDT Build Tools
WAX-CDT includes various cdt commands, built around the Clang front-end and tooling infrastructure. This collection includes various tools to build optimized, high-performance WASM files. Refer to WAX-CDT Options for more information.
It's recommended that you use cdt-init to Create a Smart Contract. This tool provides scripts to easily organize and build your project.
If these scripts do not meet your needs, you can also use the cdt-cpp command to compile your smart contracts.
Use cdt-cpp
To generate a WASM and ABI file for your smart contract:
From the command line, navigate to your smart contracts folder.
Run the cdt-cpp build command with the -abigen parameter.
TIP
cdt-cpp also includes Ricardian terms in your ABI file. Refer to Ricardian Contracts and Ricardian Clauses for more information.
cdt-cpp -abigen wax.cpp -o wax.wasm
This will generate two files in your contract's directory:
- The compiled binary WASM (wax.wasm)
- The generated ABI file (wax.abi)