Uploading Contracts
Learn how to upload individual smart contract files to BlockSecOps. | Extension | Language | Example | |-----------|----------|---------| | .sol | Solidity |...
Uploading Contracts
Learn how to upload individual smart contract files to BlockSecOps.
Supported File Types
| Extension | Language | Example |
|---|---|---|
.sol |
Solidity | Token.sol |
.vy |
Vyper | Vault.vy |
.rs |
Rust (Solana) | lib.rs |
Upload Methods
Drag and Drop
The fastest way to upload:
- Open the dashboard
- Drag your file onto the upload area
- Release to upload
File Browser
If you prefer clicking:
- Click New Scan or the upload area
- Click Browse Files
- Select your contract file
- Click Open
Paste Code
For quick testing:
- Click New Scan
- Select Paste Code tab
- Paste your contract source code
- Select the language (Solidity, Vyper, Rust)
- Click Upload
File Requirements
Size Limits
| Plan | Max File Size |
|---|---|
| Free | 1 MB |
| Developer | 5 MB |
| Startup+ | 10 MB |
File Format
- Must be valid source code
- UTF-8 encoding
- Unix or Windows line endings
What to Include
For single files:
- The main contract file
- All dependencies should be in the file OR use fully-qualified imports
Import Handling
OpenZeppelin and Common Libraries
BlockSecOps automatically resolves:
- OpenZeppelin contracts
- Common Solidity libraries
- Standard imports
Example that works:
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
Local Imports
For contracts with local imports, upload as a project instead.
Example that requires project upload:
import "./utils/Math.sol";
import "../lib/Helper.sol";
See Uploading Projects for multi-file uploads.
After Upload
Once your file uploads:
- Language Detection - Automatic based on extension
- Validation - Syntax check
- Ready for Scan - Select scanners and run
The file appears in your contracts list immediately.
Naming Your Contract
Auto-Naming
By default, contracts are named from:
- The filename (e.g.,
Token.sol) - The main contract name if parseable
Custom Names
To rename:
- Go to Contracts
- Click the contract
- Click Edit (pencil icon)
- Enter a new name
- Click Save
Organizing Contracts
Into Projects
Group related contracts:
- Create a project (see Creating Projects)
- Upload contracts to that project
- Or move existing contracts to a project
With Tags
Add tags for organization:
- Click a contract
- Click Add Tag
- Enter tag name (e.g., "DeFi", "Audited")
- Tags appear on contract cards
Troubleshooting
Upload failed
Common causes:
- File too large (check plan limits)
- Invalid file extension
- Network timeout
Solutions:
- Compress or split large files
- Ensure correct extension
- Try again with stable connection
"Invalid Solidity" error
The file may have:
- Syntax errors
- Missing pragma
- Invalid characters
Solution: Fix the errors in your editor and re-upload.
Import not found
For files with local imports:
- Use project upload instead
- Or inline all dependencies
Next Steps
- Starting a Scan - Scan your contract
- Uploading Projects - Multi-file uploads
- Managing Contracts - View and organize