Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ docs/

# Dotenv file
.env

# Local development dependencies
dev/node_modules/
dev/.venv/
48 changes: 34 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ This project is meant to be used as a templated during the creation of new Githu

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


## Usage

### Build
Expand All @@ -27,6 +26,25 @@ forge test
forge fmt
```

### Local tooling

Solhint and Slither are pinned as local development dependencies under `dev/`.
The pnpm setup waits 7 days before installing newly released packages, matching CoW repos and giving more review time than a 2-day delay.
Install them with:

```shell
pnpm --dir dev install --frozen-lockfile
python -m venv dev/.venv
dev/.venv/bin/pip install -r dev/requirements.txt
```

Use the local binaries when running these tools:

```shell
dev/node_modules/.bin/solhint --version
dev/.venv/bin/slither --version
```

### Gas Snapshots

```shell
Expand All @@ -44,18 +62,20 @@ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --priva
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
- [ ] 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
- [ ] Set up [Local tooling](#local-tooling) so Solhint and Slither use the pinned project versions
Comment thread
fedgiac marked this conversation as resolved.
- [ ] Update the project details in `dev/package.json`, including `name` and `description`
- [ ] Make sure you use the [latest version of Solidity](https://github.com/argotorg/solidity/releases) by updating the `solc` version in `foundry.toml`
- [ ] Once all entries in this list are checked, delete this section from the readme
- [ ] Once all entries in this list are checked, delete this section from the readme
11 changes: 11 additions & 0 deletions dev/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "contracts-template-dev",
"version": "0.0.0",
"private": true,
"description": "Local development dependencies for the contracts template.",
"license": "UNLICENSED",
"packageManager": "pnpm@10.33.2",
"devDependencies": {
"solhint": "6.0.3"
}
Copy link
Copy Markdown
Contributor

@fedgiac fedgiac May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just came to my mind: we can reduce the risk of supply-chain attacks by not installing packages that have been released, say, less than 2 days ago. This gives a new package 2 days to be scrutinized by the community before we install it.
This config parameter has different names based on the chosen NPM manager. For example, for pnpm it's minimumReleaseAge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I've set the value to 7 days, as the other CoW repos do!

}
Loading
Loading