Skip to main content
Version: v6

Cargo Contract Title Picture

Compile Your Contract

Run the following command in your flipper directory to compile your smart contract:

pop build

This command will build the following for your contract: a binary (.polkavm), a metadata file (.json), and a .contract file which bundles both.

If all goes well, you should see a target folder that contains these files:

target
└─ ink
└─ flipper.polkavm <-- Raw contract binary
└─ flipper.json <-- Metadata for the contract
└─ flipper.contract <-- JSON file that combines binary + metadata

Learn more about metadata and the ink! metadata format for detailed information about the structure of these files.

Debug vs. Release Build

By default, contracts are built in debug mode, which includes debugging information and increases the contract's size. For production deployments, you should always build with the --release flag:

pop build --release

This will ensure that nothing unnecessary is compiled into the binary blob, making your contract faster and cheaper to deploy and execute.