Skip to content

Conversation

@h4x3rotab
Copy link
Contributor

No description provided.

@h4x3rotab h4x3rotab marked this pull request as draft July 23, 2025 10:34
@Leechael Leechael mentioned this pull request Jul 28, 2025
h4x3rotab and others added 19 commits January 13, 2026 23:49
- Add Foundry configuration (foundry.toml) with OpenZeppelin remappings
- Migrate all Hardhat tests to Foundry Solidity tests
- Add comprehensive test coverage for DstackKms and DstackApp contracts
- Implement upgrade testing with OpenZeppelin Foundry plugin
- Create dedicated test files for core functionality vs upgrade testing
- Add contract deployment scripts for Foundry
- Include test utility contracts (DstackAppV1, DstackKmsV1) for upgrade scenarios
- Fix compilation issues with Address library usage
- Add detailed README with testing instructions and project overview

Test Status:
✅ DstackApp.t.sol: 11/11 tests PASS - Core app functionality
✅ DstackKms.t.sol: 16/16 tests PASS - Core KMS functionality
✅ UpgradesBasic.t.sol: 5/5 tests PASS - Basic upgrade functionality
⚠️ Advanced upgrade tests have OpenZeppelin validation issues

Total: 32/32 core and basic upgrade tests PASSING

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Remove all Hardhat dependencies while preserving bootAuth server:

🗑️ Removed Hardhat components:
- Config files: hardhat.config.ts, jest.integration.config.js
- Hardhat test files: test/*.test.ts, test/setup.ts
- TypeChain generated types: typechain-types/ directory
- Deployment scripts: scripts/deploy.ts, upgrade.ts, verify.ts
- Build artifacts: .openzeppelin/, cache files
- Dependencies: All @nomicfoundation/hardhat-* packages

✅ Preserved & Updated:
- BootAuth server: src/server.ts, main.ts, types.ts (fully functional)
- EthereumBackend: Updated to use ethers Contract directly (no TypeChain)
- Server tests: Moved main.test.ts to src/ (4 tests passing)
- Foundry setup: All contracts and tests working (32/32 tests passing)
- Package.json: Added Foundry test scripts, removed Hardhat deps
- Documentation: Updated README with server endpoints and usage

🎯 Final architecture:
- Foundry: Smart contract development and testing
- Node.js: HTTP API server for TEE boot validation
- Zero Hardhat dependencies

All tests passing:
- Foundry: 32/32 core contract tests ✅
- Server: 4/4 HTTP API tests ✅
- TypeScript compilation: Success ✅

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Remove all files from out/ directory (Foundry build output)
- Add /out to .gitignore to prevent tracking build artifacts
- Clean up repository by excluding generated files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Remove Upgrades.t.sol (duplicate functionality)
- Remove UpgradesBasic.t.sol (only using plugin-based upgrades)
- Keep UpgradesWithPlugin.t.sol as the comprehensive upgrade test suite
- Update README documentation to reflect simplified test structure
- Maintain 27/27 core functionality tests passing

This streamlines the test suite by keeping only the most comprehensive
upgrade tests that use the OpenZeppelin Foundry Upgrades plugin.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Create modular test scripts for better flexibility
- Add setup-local-chain.sh to start Anvil and deploy contracts
- Add run-tests.sh to run tests against existing chain
- Add test-all.sh for complete test runs
- Add cleanup.sh to stop all test processes
- Update .gitignore to exclude test logs and env files
- Remove old monolithic test-with-anvil.sh script
- Add comprehensive documentation in scripts/README.md

This allows developers to:
- Set up chain once and run tests multiple times
- Run different test suites independently
- Better integrate with CI/CD pipelines
- Debug issues more easily with separate logs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Update test coverage to show all 36 tests passing (100% success)
- Add documentation for new modular testing scripts
- Include local integration testing workflow instructions
- Add deployment script documentation
- Remove outdated notes about failing tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Replace foundry-cast-cheatsheet.md with migration notice
- Remove duplicate Interact.s.sol file
- Remove duplicate ShowKmsInfo from Manage.s.sol
- Streamline README.md, TESTING.md to focus on essentials
- Update script/README.md to remove development notes
- All Cast operations now covered by type-safe Foundry scripts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Remove --with-foundry flag and associated npm scripts. Foundry tests now
always run as part of the standard test suite.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Move .github/workflows/test.yml from kms/auth-eth to repository root
- Rename to foundry-test.yml for clarity
- Add --ffi flag to forge test command (required for OpenZeppelin upgrades plugin)
- Configure workflow to only run on kms/auth-eth/** path changes
- Set working-directory to kms/auth-eth for all steps
- Fix empty build-info JSON file issue that was causing test failures

All 36 tests now passing:
- 16 DstackKms tests
- 11 DstackApp tests
- 9 Upgrade tests with OpenZeppelin plugin

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add view modifier to test_Initialize() in DstackApp.t.sol
- Add view modifier to test_SupportsInterface() in DstackApp.t.sol
- Add view modifier to test_Initialize() in DstackKms.t.sol
- Add view modifier to test_SupportsInterface() in DstackKms.t.sol

This resolves Solidity compiler warnings about function state mutability
and makes the code more explicit about which test functions only read state.

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <[email protected]>
Run forge fmt to apply consistent formatting to all Solidity files:
- Update interface definitions formatting
- Improve multi-line function declarations
- Standardize spacing and indentation
- Format test files and scripts

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <[email protected]>
- Update onchain-governance.md with Foundry script commands
- Update CLAUDE.md build commands (Hardhat → Foundry)
- Update kms-release.yml workflow to use Foundry toolchain
- Fix Manage.s.sol to use PRIVATE_KEY for broadcast

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update solc_version in foundry.toml to 0.8.24
- Update pragma in all contracts, tests, and scripts
- Fix fuzz_runs -> fuzz.runs in CI profile

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants