Skip to main content

Building the Project

The CoW Protocol contracts project uses a hybrid build system compiling both Solidity smart contracts and TypeScript bindings.

Prerequisites

  • Node.js v16 or higher
  • Yarn package manager
  • Git

Installation

Build Commands

Full Build

Compiles Solidity contracts and generates TypeScript bindings:

Solidity Only

Runs Hardhat compiler with force flag:

TypeScript Only

Compiles in ESM, CommonJS, and default formats:

Compiler Settings

The project is configured for gas-efficient contract execution: This prioritizes minimal execution costs over deployment expenses.

Output Structure

Successful builds generate:

Linting and Formatting

Solidity

TypeScript

Troubleshooting

If you encounter build issues:
  1. Clear build artifacts:
  2. Reinstall dependencies:
  3. Force rebuild:
Last modified on March 4, 2026