Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Compiling contracts

Meheret Tesfaye edited this page Aug 5, 2019 · 3 revisions

Cobra's compile command enables us to compile our decentralized application and deploy it accordingly. It compiles our Smart Contracts. This will be compile all smart contracts along with imported sources.

Location

Cobra would automatically fetch all Solidity files from solidity_path directory from cobra.yaml. As contracts are written in Solidity, all files containing contracts will have a file extension of sol. Associated Solidity libraries will also have a sol extension.

Command

The command comes with integrated solidity compiler.

Running compile command

cobra compile

Optional command --more is to see more view errors when compiling a project.

cobra compile --more

Note: Any source code that has changed will be recompiled.

Build artifacts

All compiled artifact contracts will have a file extension of json object. Artifacts of your compilation will be placed in the artifact_path directory from cobra.yaml, relative to your project root. (This directory will be created if it does not exist.)

These artifacts are integral to the inner workings of Cobra, and they play an important part in the successful deployment of your application. You should not edit these files as they'll be overwritten by contract compilation and deployment. See cobra compile configuration.

Clone this wiki locally