Skip to content

LazerTechnologies/LazerForge

Repository files navigation

LazerForge Logo

LazerForge

LazerForge is a Foundry template for smart contract development. For more information on Foundry check out the foundry book.

Overview

LazerForge is a batteries included template with the following configurations:

  • OpenZeppelin, Solady, and the full Uniswap suite (v2, v3-core & v3-periphery, v4-core & v4-periphery) smart contracts are included as dependencies along with solc remappings so you can work with a wide range of deployed contracts out of the box!
  • forge fmt configured as the default formatter for VSCode projects
  • Github Actions workflows that run forge fmt --check and forge test on every push and PR
    • A separate action to automatically fix formatting issues on PRs by commenting !fix on the PR
  • A pre-configured, but still minimal foundry.toml

Quick Start

  1. Install Foundry:
curl -L https://foundry.paradigm.xyz | bash
foundryup
  1. Create a new project using one of the templates:

Full repo with example contracts, Uniswap dependencies, and docs:

forge init --template lazertechnologies/lazerforge <project_name>

Minimal repo with just optimized config:

forge init --template lazertechnologies/lazerforge --branch minimal <project_name>
  • DeFi Starter: 🚧 coming soon
  • NFT Starter: 🚧 coming soon
  • Stablecoin Starter: 🚧 coming soon
  • Cross-Chain starter: 🚧 coming soon
  1. Build the project:
forge build

Branch Structure

LazerForge maintains two primary branches to cater to different needs:

  • main Branch: Contains tutorials, additional example contracts, and comprehensive dependencies.
  • minimal Branch: Provides a lightweight template without extra tutorials and dependencies.

For detailed info on branches and contribution, check out the Contributing Guide.

See sync script usage for automating branch sync.

Reinitialize Submodules

When working across branches with different dependencies, submodules may need to be reinitialized. Run

./reinit-submodules

Gas Snapshots

Forge can generate gas snapshots for all test functions to see how much gas contracts will consume, or to compare gas usage before and after optimizations.

forge snapshot

Coverage Reports

If you plan on generating coverage reports, you'll need to install lcov as well.

On macOS, you can do this with the following command:

brew install lcov

To generate reports, run

./coverage-report

Documentation

For detailed guides on various aspects of LazerForge, check out:

About

Foundry templates and tutorials for all Solidity developers

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published