Skip to content

yoprotocol/core-v2

Repository files navigation

core-v2

Solidity smart contracts for the core-v2 protocol.

Tech Stack

  • Foundry — Solidity development framework
  • Bun — package manager
  • Just — command runner
  • Bulloak — BTT test scaffolding
  • Solhint — Solidity linter
  • Prettier — formatter for non-Solidity files
  • mdformat — Markdown formatter

Getting Started

Prerequisites

Install the required tools:

Setup

git clone <repo-url> && cd core-v2
bun install
just setup

The setup recipe installs dependencies, creates .env from the example, and installs mdformat.

Usage

Run just --list to see all available commands. Key recipes:

Build

just build        # or: just b
just build-optimized  # production build with via_ir

Test

just test         # full test suite (just t)
just test-lite    # fast — no optimizer, skips fork tests (just tl)
just test-optimized   # test against optimized artifacts (just to)
just test-bulloak # check BTT compliance (just tb)

Format & Lint

just full-check   # run ALL checks: mdformat, solhint, forge fmt, prettier (just fc)
just full-write   # auto-fix ALL formatting issues (just fw)

Individual checks:

just fmt-check / just fmt-write         # Forge formatter
just solhint-check / just solhint-write # Solidity linter (just sc / sw)
just prettier-check / just prettier-write   # JSON, YAML, SVG (just pc / pw)
just mdformat-check / just mdformat-write   # Markdown (just mc / mw)

Clean

just clean        # remove build artifacts (just c)

Coverage

just coverage     # generate lcov + HTML report (just cov)

Requires lcov installed (brew install lcov).

Gas Report

just gas-report   # or: just gr

Deploy

just deploy --rpc-url <rpc> --private-key <key>

Foundry Profiles

Profile Purpose Activate
default Standard dev — optimizer on, 1k fuzz runs (default)
lite Fast iteration — no optimizer, 10 fuzz runs FOUNDRY_PROFILE=lite
optimized Production — via_ir, separate output FOUNDRY_PROFILE=optimized
test-optimized Test optimized artifacts FOUNDRY_PROFILE=test-optimized

Installing Dependencies

This project uses Node.js packages (not git submodules) for dependency management:

  1. Install: bun install dependency-name
  2. Add a remapping in remappings.txt

OpenZeppelin Contracts is pre-installed as a reference.

Contributing

See CONTRIBUTING.md.

License

This project is licensed under MIT.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages