Skip to content
Merged
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
31 changes: 17 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 @@ -15,6 +14,10 @@ It will contain some useful configuration files and scripts, that can be used al
forge build
```

Project contracts should keep simple caret pragmas like `^0.8` so downstream projects can import them with older compatible Solidity 0.8 compilers.

If specific features are needed (like PUSH0 in 0.8.20 for gas optimizations or transient storage/better `via-ir` in 0.8.34), you can use it but make sure to keep the caret (`^`).

### Test

```shell
Expand Down Expand Up @@ -44,18 +47,18 @@ 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
- [ ] 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
7 changes: 5 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
src = "src"
out = "out"
libs = ["lib"]
solc = "0.8.33" # See latest release at: https://github.com/argotorg/solidity/releases
solc = "0.8.34" # See latest release at: https://github.com/argotorg/solidity/releases

[fmt]
sort_imports = true
number_underscore = "thousands"

[profile.ci]
deny = "warnings" # Why not always: sometimes you just want to code and see what comes out
fuzz.seed = '0' # It makes CI reproducible, but still on a local machine it tries different parameters and so we can see edge cases if needed.
verbosity = 3 # Outputs stack traces for failed tests.
fuzz.seed = "0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

my concern with overriding this with CI config only is, in unlikely cases, the CI result might become unreproducible on local and its unclear why.

fuzz.runs = 10_000
2 changes: 1 addition & 1 deletion script/Counter.s.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity ^0.8;

import {Counter} from "../src/Counter.sol";
import {Script} from "forge-std/Script.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/Counter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity ^0.8;

contract Counter {
uint256 public number;
Expand Down
2 changes: 1 addition & 1 deletion test/Counter.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity ^0.8;

import {Counter} from "../src/Counter.sol";
import {Test} from "forge-std/Test.sol";
Expand Down
Loading