Skip to content

cowprotocol/contracts-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contract Template

Template for creating new smart contract projects.

This project is meant to be used as a templated during the creation of new Github repositories (will show in the Create a new repository > Configuration > Start with a template selector).

It will contain some useful configuration files and scripts, that can be used also with existing projects (manually copied).

Usage

Build

forge build

Test

forge test

Format

forge fmt

Gas Snapshots

forge snapshot

Deploy

forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

New project creation checklist

The following operations need to be performed after this repository has been created.

  • In GitHub repo settings:
    • Add a new ruleset called "Protected branches" and include the following changes:
      • Enforcement status: active
      • Target branches: Include default branch
      • Require linear history
      • Require a pull request before merging
        • Required approvals: 1
        • Allowed merge methods: Squash
      • Block force pushes
    • In General → Features → Pull requests:
      • Select "Pull request title and description" in "Default commit message" option
      • Unckeck "Allow merge commits" option
      • Check "Allow auto-merge" option
  • Run forge install to install the dependencies. This will create a new foundry.lock file which you should commit to the project
  • Make sure you use the latest version of Solidity by updating the solc version in foundry.toml
  • Once all entries in this list are checked, delete this section from the readme

About

Template for solidity projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors