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
66 changes: 40 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
name: Foundry
name: CI

on:
push:
pull_request:
workflow_dispatch:
pull_request_target:

env:
BLS_PRIVATE_KEY: ${{ secrets.BLS_KEY }}

FOUNDRY_PROFILE: ci

jobs:
check:
foundry:
strategy:
fail-fast: true

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: Install hardhat
run: |
yarn add --dev hardhat
id: hardhat-install

- name: Show Forge version
run: |
forge --version
run: forge --version

- name: Install soldeer dependencies
run: forge soldeer install

- name: Run Forge fmt
run: |
forge fmt --check
run: forge fmt --check
id: fmt

- name: Run Forge build
run: |
forge build --force --skip test --sizes
run: forge build --sizes
id: build

- name: Run Forge tests
run: |
FOUNDRY_PROFILE=test forge test --gas-report
id: forge-test

- name: Run foundry coverage
run: FOUNDRY_PROFILE=coverage forge coverage --report summary
run: forge test -vvv
id: test

hardhat:
needs: foundry
runs-on: ubuntu-latest
name: Hardhat tests
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- name: Install soldeer dependencies
run: forge soldeer install

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Run Hardhat tests
run: |
npx hardhat test
id: hardhat-test
run: npx hardhat test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,7 @@ broadcast

# Deployments
script/json/Deployment_input.json
flat/
flat/

# Soldeer
/dependencies
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

7 changes: 6 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
libs = ["lib", "dependencies"]
optimizer = true
optimizer_runs = 200
solc_version = '0.8.28'
Expand All @@ -26,4 +26,9 @@ gas_reports = ["*"]
via_ir = true
no_match_coverage = "(script|test)"

[dependencies]
forge-std = "1.10.0"
"@openzeppelin-contracts" = "5.4.0"
"@openzeppelin-contracts-upgradeable" = "5.4.0"

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
1 change: 0 additions & 1 deletion lib/forge-std
Submodule forge-std deleted from 77041d
1 change: 0 additions & 1 deletion lib/openzeppelin-contracts
Submodule openzeppelin-contracts deleted from e4f702
1 change: 0 additions & 1 deletion lib/openzeppelin-contracts-upgradeable
Submodule openzeppelin-contracts-upgradeable deleted from 60b305
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"build": "npm run build:forge && npm run build:hardhat",
"build:forge": "FOUNDRY_PROFILE=build forge install && FOUNDRY_PROFILE=build forge build",
"build:forge": "FOUNDRY_PROFILE=build forge soldeer install && FOUNDRY_PROFILE=build forge build",
"build:hardhat": "npx hardhat compile",
"test": "npm run test:forge && npm run test:hardhat",
"test:forge": "FOUNDRY_PROFILE=test forge test --gas-report",
Expand Down Expand Up @@ -96,5 +96,6 @@
"@typechain/hardhat": "^9.0.0",
"ethers": "^6.13.3",
"prettier-plugin-solidity": "^1.3.1"
}
},
"type": "commonjs"
}
6 changes: 3 additions & 3 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@forge-std/=lib/forge-std/src/
@ds-test/=lib/forge-std/lib/ds-test/src/

@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
@openzeppelin/contracts-upgradeable/=dependencies/@openzeppelin-contracts-upgradeable-5.4.0/
@openzeppelin/contracts/=dependencies/@openzeppelin-contracts-5.4.0/
forge-std/=dependencies/forge-std-1.10.0/src/
20 changes: 20 additions & 0 deletions soldeer.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[dependencies]]
name = "@openzeppelin-contracts"
version = "5.4.0"
url = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts/5_4_0_19-07-2025_08:59:41_contracts.zip"
checksum = "3dd38f17610dba4602bd008ee2cb551e51e97d7b4ce04e1ffdf853da832942fa"
integrity = "4eb0ef219d10ab5a5708adaae1132dc0a93ab6a193378486e842d606c989ff3e"

[[dependencies]]
name = "@openzeppelin-contracts-upgradeable"
version = "5.4.0"
url = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts-upgradeable/5_4_0_19-07-2025_08:59:45_contracts-upgradeable.zip"
checksum = "bc405f98749d27dc19e747f1e797f3df59ccf6c9781ab39369892eaf700ac40b"
integrity = "eeb22da11d2b7a8202e43a3a91978f0d9e6cdabfe006cf799f57282065267a1a"

[[dependencies]]
name = "forge-std"
version = "1.10.0"
url = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_10_0_02-08-2025_06:50:35_forge-std-1.10.zip"
checksum = "8cc59e92a7762c170c15f2102c4f3718106dfc78239978fe87c64f316740cc09"
integrity = "3fd441e2499c5cf04ef9b4126f52150a50dcef9cac1645ff7a955345e947cd04"
4 changes: 2 additions & 2 deletions test/hardhat/blocklock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ describe("Blocklock integration tests", () => {
let tx = await mockBlocklockReceiverInstance
.connect(wallet)
.createTimelockRequestWithDirectFunding(callbackGasLimit, encodedCondition, encodeCiphertextToSolidity(ct), {
value: ethers.parseEther("2")
value: ethers.parseEther("2"),
});

let receipt = await tx.wait(1);
Expand Down Expand Up @@ -739,7 +739,7 @@ describe("Blocklock integration tests", () => {
let tx = await mockBlocklockReceiverInstance
.connect(wallet)
.createTimelockRequestWithDirectFunding(callbackGasLimit, encodedCondition, encodeCiphertextToSolidity(ct), {
value: ethers.parseEther("2")
value: ethers.parseEther("2"),
});

let receipt = await tx.wait(1);
Expand Down