Skip to main content

compile

Overview

Taq compile is used to compile smart contracts to Michelson. It is implemeted by compiler plugins and can be used to compile one or more contracts in one or more languages / dialects

The Michelson contracts produced by the compilers will be created in the /artifacts directory

note

Contracts must be added to the Contract Registry (taq add-contract example.mligo) in order to be compiled

Plugin Implementations

This task is implemented by the following plugins:

Plugin NameDescription
@taqueria/plugin-ligoCompiles Ligo contracts
@taqueria/plugin-smartpyCompiles SmartPy contracts
@taqueria/plugin-archetypeCompiles Archetype contracts

Command

taq compile <path> 

Task Details

Task NameCommandTypeDescription
compiletaq compile [path]Plugin - compilersCompiles one, or all contracts in a project

Command-Line Arguments

ArgumentRequiredDescriptionExample Usage
<path>NoPath to one or more Ligo, SmartPy, or Archetype filestaq compile ./contracts/my-contract.jsligo
--pluginNoCompiles contracts using the compiler plugin specifiedtaq compile --plugin archetype
-eNoThe entry point that will be compiledtaq compile ./contracts/test.mligo -e transferTo
-sNoThe syntax used in the contracttaq compile -s jsligo
-iNoEnable type inferencetaq compile ./contracts/counter.mligo -i

Usage

DescriptionCommandBehaviour
Compile all contractstaq compileCompiles all Ligo, SmartPy, and Archetype files in the /contracts directory
Compile one contracttaq compile [path]Compiles the contract at the given path
Compile Ligo contractstaq compile --plugin ligoCompiles Ligo contracts using the Ligo compiler
Compile SmartPy contractstaq compile --plugin smartpyCompiles SmartPy contracts using the SmartPy compiler
Compile Archetype contractstaq compile --plugin archetypeCompiles Archetype contracts using the Archetype compiler
note

The --plugin option is only available when multiple compiler plugins are installed on a project

Supported Filetypes

TypeExtension
Michelson.tz
JsLigo.jsligo
CameLigo.mligo
PascaLigo.pligo
ReasonLigo.rligo

Multi-File Contracts

note

When developing multi-file LIGO contracts, you only need to add the file that contains the main entrypoint for each multi-file smart contract to the contract registry. The other files will be automatically included during compilation

Using in a Taqueria Workflow

The compiile task is used to produce Michelson code that can be deployed to a sandbox or testnet

note

Support for mainnet will be coming soon