Skip to content

Commands

smol-ninja edited this page Jan 29, 2025 · 7 revisions

This is a list of the most useful commands.

Install Dependencies

Install node dependencies using the bun lockfile:

bun install --frozen-lockfile

Clean

Delete the old artifacts and cache directories:

bun run clean

Build

Build contracts using the default profile:

bun run build

Build contracts using the optimized profile, to compile the contracts with the --via-ir flag enabled:

bun run build:optimized

Build contracts using smt profile, to compile the contracts with the SMTChecker enabled, while ignoring any warnings due to the use of assembly blocks:

bun run build:smt

This will attempt to formally prove the correctness of the contracts by trying to break invariants (e.g. by finding failing assert statements).

Tests

Run tests using the default profile:

bun run test

Run tests against the optimized version of the contracts:

bun run test:optimized

Lint

Lint the entire code base (Solidity + other files):

bun run lint:fix

Lint only the contracts:

bun run lint:sol:fix

Gas Benchmarks

Get a Gas benchmark report for all the functions:

bun run benchmark

Others

You can find the list of all available commands in package.json. If you are interested into looking available forge commands, head out to the forge book.

Clone this wiki locally