From f148526efa2043e2701c8b35ecff19ca869c0ce8 Mon Sep 17 00:00:00 2001 From: adjoly Date: Thu, 24 Jul 2025 12:42:33 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=8E=89=E3=80=8D=20init:=20starte?= =?UTF-8?q?d=20blockchain=20dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 40 ++++++++++++++++++++++++++++++++++++++ .gitignore | 7 ++++++- .solhint.json | 3 +++ flake.nix | 5 +++++ foundry.toml | 6 ++++++ src/contract/main.sol | 7 +++++++ 6 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml create mode 100644 .solhint.json create mode 100644 foundry.toml create mode 100644 src/contract/main.sol diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4481ec6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + +env: + FOUNDRY_PROFILE: ci + +jobs: + check: + name: Foundry project + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Show Forge version + run: | + forge --version + + - name: Run Forge fmt + run: | + forge fmt --check + id: fmt + + - name: Run Forge build + run: | + forge build --sizes + id: build + + - name: Run Forge tests + run: | + forge test -vvv + id: test diff --git a/.gitignore b/.gitignore index 438ac14..b63ca91 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,9 @@ node_modules/ .env # built files -dist/* +dist + +# foundry files +lib +out +cache diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 0000000..ce2220e --- /dev/null +++ b/.solhint.json @@ -0,0 +1,3 @@ +{ + "extends": "solhint:recommended" +} diff --git a/flake.nix b/flake.nix index 62eb6a2..698748e 100644 --- a/flake.nix +++ b/flake.nix @@ -39,12 +39,17 @@ nodejs_22 pnpm just + foundry ]; shellHook = '' if [ ! -d node_modules/ ]; then echo Installing node env pnpm install fi + if [ ! -d lib/ ]; then + echo Installing foundry env + forge i + fi export PATH+=:$(pwd)/node_modules/.bin echo entering ft_trans env ''; diff --git a/foundry.toml b/foundry.toml new file mode 100644 index 0000000..5a859ad --- /dev/null +++ b/foundry.toml @@ -0,0 +1,6 @@ +[profile.default] +src = "src/contract" +out = "out" +libs = ["node_modules", "lib"] + +# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/src/contract/main.sol b/src/contract/main.sol new file mode 100644 index 0000000..4464fd4 --- /dev/null +++ b/src/contract/main.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8; + +contract scoreStore { + +}