-
Notifications
You must be signed in to change notification settings - Fork 58
Migrate to Foundry #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
h4x3rotab
wants to merge
18
commits into
master
Choose a base branch
from
foundry
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Migrate to Foundry #252
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
827c533
WIP: Migrate Hardhat to Foundry with comprehensive test suite
h4x3rotab 63adb7f
Complete Hardhat removal - migrate to pure Foundry setup
h4x3rotab 897d885
Remove Foundry build artifacts and update .gitignore
h4x3rotab 840ae21
Clean up test suite - remove duplicate upgrade tests
h4x3rotab d876b6f
wip
h4x3rotab 2018262
wip
h4x3rotab 4dcdfe5
refactor: modularize Anvil testing with separate setup and run scripts
h4x3rotab e452f63
docs: update README with 100% test pass rate and new testing workflow
h4x3rotab d6f1860
chore: remove unnecessary files
h4x3rotab 8af97e5
Clean up documentation and remove script overlaps
h4x3rotab 4700508
remove unused code
h4x3rotab 396ac69
refactor: make Foundry tests run by default
h4x3rotab 1a5e352
branding: s/(DS|Ds)tack/dstack
h4x3rotab 24fcaf3
fix spdx annotation
h4x3rotab 7dcdf7c
fix: move Foundry CI workflow to repository root and add --ffi flag
h4x3rotab 206953c
fix: add view modifier to pure assertion test functions
h4x3rotab f96667c
chore: format Solidity code with forge fmt
h4x3rotab 0dfbdbb
fix: add --ffi flag to forge test in run-tests.sh
h4x3rotab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: KMS Auth-ETH Foundry Tests | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'kms/auth-eth/**' | ||
| - '.github/workflows/foundry-test.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'kms/auth-eth/**' | ||
| - '.github/workflows/foundry-test.yml' | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| FOUNDRY_PROFILE: ci | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Foundry project | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: kms/auth-eth | ||
| 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 --ffi -vvv | ||
| id: test | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| [submodule "kms/auth-eth/lib/forge-std"] | ||
| path = kms/auth-eth/lib/forge-std | ||
| url = https://github.com/foundry-rs/forge-std | ||
| [submodule "kms/auth-eth/lib/openzeppelin-contracts-upgradeable"] | ||
| path = kms/auth-eth/lib/openzeppelin-contracts-upgradeable | ||
| url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable | ||
| [submodule "kms/auth-eth/lib/openzeppelin-foundry-upgrades"] | ||
| path = kms/auth-eth/lib/openzeppelin-foundry-upgrades | ||
| url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network> | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Example environment configuration for local testing | ||
|
|
||
| # Server configuration | ||
| PORT=8000 | ||
| HOST=127.0.0.1 | ||
|
|
||
| # Ethereum configuration | ||
| ETH_RPC_URL=http://127.0.0.1:8545 | ||
| KMS_CONTRACT_ADDR=0x0000000000000000000000000000000000000000 | ||
|
|
||
| # For testing with local Anvil node (Foundry): | ||
| # ETH_RPC_URL=http://127.0.0.1:8545 | ||
| # KMS_CONTRACT_ADDR=<deployed_contract_address> | ||
|
|
||
| # For testing with testnet: | ||
| # ETH_RPC_URL=https://rpc.sepolia.org | ||
| # KMS_CONTRACT_ADDR=<your_deployed_contract_address> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,11 @@ | ||
| /artifacts | ||
| /cache | ||
| /dist | ||
| /out | ||
| /out | ||
|
|
||
| # Test logs | ||
| anvil-test.log | ||
| anvil.log | ||
| deploy.log | ||
| server-test.log | ||
| .env.test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 9 days ago
To fix the problem, you should add a
permissionsblock to the workflow. This block can be added either at the root level (applying to all jobs unless individually overridden) or specifically to thecheckjob shown. The minimal starting point for most build/test pipelines iscontents: read— this prevents the workflow from making any modifications to repository content, but still allows it to check out code and read repository metadata. Add the following at the top level of the workflow (after thename:key is typical), e.g. after line 5. No imports or definitions are needed; just a one-line-permission YAML key insert.