Blockchain security research project, utilizing Foundry for smart contract development and testing.
BlockChainSecurity/
├── src/
│ ├── interface.sol # Contract interface definitions
│ └── test/
│ └── gmx_exp.sol # GMX related test contracts
├── lib/ # Dependencies
├── out/ # Compilation output
├── foundry.toml # Foundry configuration
└── docker-compose.yml # Docker configuration
# Start container (newer Docker Desktop uses docker compose, older versions use docker-compose)
docker compose up -d --build
# or
docker-compose up -d --build
# Execute commands in container
docker compose exec lab forge <command>
# or
docker-compose exec lab forge <command>-
Install Git for Windows (if not already installed):
- Download and install from Git official website
- Select "Add Git Bash to PATH" during installation
-
Install Foundry using Git Bash:
- Open Git Bash (not PowerShell)
- Run the following commands:
curl -L https://foundry.paradigm.xyz | bash foundryup -
Add Foundry to system PATH:
- Press
Win + R, typesysdm.cpl, press Enter - Click "Environment Variables"
- Find
Pathin "System variables", click "Edit" - Click "New", add:
C:\Users\<YourUsername>\.foundry\bin - Click OK and restart PowerShell
- Press
-
Verify installation:
forge --version
Note: Foundryup currently does not support PowerShell or Cmd. You must use Git Bash or WSL to run the installation commands.
curl -L https://foundry.paradigm.xyz | bash
foundryupRun GMX related tests using Docker:
docker compose up -d --build
docker compose exec lab forge test --contracts ./src/test/gmx_exp.sol -vvvOr using the legacy command format:
docker-compose up -d --build
docker-compose exec lab forge test --contracts ./src/test/gmx_exp.sol -vvvNote: Synchronizing past blocks may take some time.
# Format all Solidity files
forge fmt
# Check format only (does not modify files)
forge fmt --check
# Format specific file
forge fmt src/test/gmx_exp.sol# Ensure container is running
docker compose up -d
# Format all Solidity files (changes sync back to local)
docker compose exec lab forge fmt
# Check format only (does not modify files)
docker compose exec lab forge fmt --check
# Format specific file
docker compose exec lab forge fmt src/test/gmx_exp.solNote: When using Docker, formatted files automatically sync back to local due to volume mounting.
The project uses GitHub Actions for continuous integration. On every push or PR, it automatically runs:
- ✅ Code format check (
forge fmt --check) - ✅ Contract compilation (
forge build) - ✅ Test execution (
forge test)