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
77 changes: 0 additions & 77 deletions README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Foundry

**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**

Foundry consists of:

- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.

## Documentation

https://book.getfoundry.sh/

## Usage

### Build

```shell
$ forge build
```

### Test

```shell
$ forge test
```

### Format

```shell
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

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

### Cast

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/Vm.sol linguist-generated
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @danipopes @klkvr @mattsse @grandizzy @yash-atreya @zerosnacks @onbjerg @0xrusowsky
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: CI

permissions: {}

on:
workflow_dispatch:
pull_request:
push:
branches:
- master

jobs:
build:
name: build +${{ matrix.toolchain }} ${{ matrix.flags }}
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
strategy:
fail-fast: false
matrix:
toolchain: [stable, nightly]
flags:
- ""
- --via-ir
- --use solc:0.8.17 --via-ir
- --use solc:0.8.17
- --use solc:0.8.0
- --use solc:0.7.6
- --use solc:0.7.0
- --use solc:0.6.2
- --use solc:0.6.12
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: foundry-rs/foundry-toolchain@v1
- run: forge --version
- run: |
case "${{ matrix.flags }}" in
*"solc:0.8.0"* | *"solc:0.7"* | *"solc:0.6"*)
forge build --skip test --skip Config --skip StdConfig --skip LibVariable --deny-warnings ${{ matrix.flags }}
;;
*)
forge build --skip test --deny-warnings ${{ matrix.flags }}
;;
esac
# via-ir compilation time checks.
- if: contains(matrix.flags, '--via-ir')
run: forge build --skip test --deny-warnings ${{ matrix.flags }} --contracts 'test/compilation/*'

test:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
strategy:
fail-fast: false
matrix:
toolchain: [stable, nightly]
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: foundry-rs/foundry-toolchain@v1
with:
version: ${{ matrix.toolchain }}
- run: forge --version
- run: |
if [ "${{ matrix.toolchain }}" = "stable" ]; then
forge test -vvv --no-match-path "test/Config.t.sol"
else
forge test -vvv
fi

fmt:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: foundry-rs/foundry-toolchain@v1
- run: forge --version
- run: forge fmt --check

typos:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: crate-ci/typos@7436548694def3314aacd93ed06c721b1f91ea04 # v1

codeql:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

ci-success:
runs-on: ubuntu-latest
if: always()
needs:
- build
- test
- fmt
- typos
- codeql
timeout-minutes: 10
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Sync Release Branch

permissions: {}

on:
release:
types:
- created

jobs:
sync-release-branch:
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.event.release.tag_name, 'v1')
steps:
- name: Check out the repo
uses: actions/checkout@v5
with:
persist-credentials: true
fetch-depth: 0
ref: v1

# The email is derived from the bots user id,
# found here: https://api.github.com/users/github-actions%5Bbot%5D
- name: Configure Git
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

- name: Sync Release Branch
run: |
git fetch --tags
git checkout v1
git reset --hard ${GITHUB_REF}
git push --force
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cache/
out/
.vscode
.idea
Loading