Uploading Projects
Learn how to upload multi-file projects (Foundry, Hardhat) to BlockSecOps. Use project upload when you have: - Multiple contract files - Local imports between...
Uploading Projects
Learn how to upload multi-file projects (Foundry, Hardhat) to BlockSecOps.
When to Use Project Upload
Use project upload when you have:
- Multiple contract files
- Local imports between files
- A Foundry or Hardhat project structure
- Dependencies managed by a package manager
Supported Frameworks
| Framework | Config File | Detected By |
|---|---|---|
| Foundry | foundry.toml |
Config file presence |
| Hardhat | hardhat.config.js or .ts |
Config file presence |
Both frameworks are auto-detected based on configuration files.
Creating a Project Archive
From Foundry Project
- Navigate to your project root
- Create a ZIP archive:
# Include essential files only
zip -r myproject.zip src/ lib/ foundry.toml remappings.txt
From Hardhat Project
- Navigate to your project root
- Create a ZIP archive:
# Include contracts and config
zip -r myproject.zip contracts/ hardhat.config.js
What to Include
Include:
- Source contracts (
src/,contracts/) - Library dependencies (
lib/,node_modules/@openzeppelin/) - Configuration files (
foundry.toml,hardhat.config.js) - Remappings (
remappings.txt)
Exclude:
- Build artifacts (
out/,artifacts/,cache/) - Test files (optional, but reduces size)
- Documentation
- CI/CD files
Upload Methods
Drag and Drop
- Create your ZIP archive
- Drag the
.zipfile to the upload area - BlockSecOps detects the framework automatically
File Browser
- Click New Scan
- Select Browse Files
- Choose your
.zip,.tar, or.tar.gzarchive - Click Open
Archive Requirements
Supported Formats
| Format | Extension |
|---|---|
| ZIP | .zip |
| Tarball | .tar |
| Gzipped Tarball | .tar.gz, .tgz |
Size Limits
| Plan | Max Archive Size |
|---|---|
| Free | 5 MB |
| Developer | 10 MB |
| Startup+ | 20 MB |
File Count
Maximum files per archive: 500
Framework Detection
Foundry Projects
BlockSecOps detects Foundry when it finds:
foundry.tomlin the rootsrc/directory with.solfiles
Remappings:
remappings.txtis read automaticallyfoundry.tomlremappings are also parsed
Hardhat Projects
BlockSecOps detects Hardhat when it finds:
hardhat.config.jsorhardhat.config.tscontracts/directory
Dependencies:
- OpenZeppelin imports are resolved
- Include
node_modules/for other dependencies
Import Resolution
How Imports Are Resolved
- Remappings - Checked first (
@openzeppelin/→lib/openzeppelin/) - Relative paths -
./and../from the importing file - Node modules -
node_modules/directory - Built-in libraries - OpenZeppelin, Solmate, etc.
Common Import Patterns
These work automatically:
// OpenZeppelin (auto-resolved)
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// Relative imports (resolved from file location)
import "./utils/Math.sol";
import "../interfaces/IVault.sol";
// Remapped imports (from remappings.txt)
import "solmate/tokens/ERC20.sol";
After Upload
Once your project uploads:
- Framework Detection - Foundry/Hardhat identified
- File Extraction - Archive contents processed
- Import Resolution - Dependencies linked
- Ready for Scan - Select scanners and run
Scanning Projects
All Files
By default, all contract files are scanned.
Specific Files
To scan specific files:
- After upload, click Select Files
- Check the files to scan
- Click Continue
Fuzzing Scanners
Fuzzing scanners (Echidna, Medusa, Halmos) only appear for projects:
- They require test harnesses
- Single-file contracts don't support fuzzing
Troubleshooting
"No contracts found"
Your archive may be missing source files:
- Ensure
src/orcontracts/exists - Check that
.solfiles are included - Verify the archive structure
"Import not found"
An import couldn't be resolved:
- Include the dependency in your archive
- Check remappings are correct
- For npm packages, include
node_modules/
"Archive too large"
The upload exceeds your plan limit:
- Exclude
out/,artifacts/,cache/directories - Exclude test files
- Compress more aggressively
Framework not detected
Config file may be missing:
- For Foundry: include
foundry.toml - For Hardhat: include
hardhat.config.js - Place config in archive root
Example: Foundry Project
Directory Structure
my-project/
├── foundry.toml
├── remappings.txt
├── src/
│ ├── Token.sol
│ └── Vault.sol
└── lib/
└── openzeppelin-contracts/
└── contracts/
└── token/
└── ERC20/
└── ERC20.sol
Create Archive
cd my-project
zip -r my-project.zip src/ lib/ foundry.toml remappings.txt
Upload
Drag my-project.zip to BlockSecOps.
Example: Hardhat Project
Directory Structure
my-project/
├── hardhat.config.js
├── contracts/
│ ├── Token.sol
│ └── Vault.sol
└── node_modules/
└── @openzeppelin/
└── contracts/
└── token/
└── ERC20/
└── ERC20.sol
Create Archive
cd my-project
zip -r my-project.zip contracts/ node_modules/@openzeppelin/ hardhat.config.js
Upload
Drag my-project.zip to BlockSecOps.
Next Steps
- Starting a Scan - Scan your project
- Scanner Catalog - Available scanners
- Managing Contracts - Organize contracts