A lightweight developer tool built with Rust to scaffold cleanly structured Solidity contracts. Choose from multiple templates, apply customizable section headers, and follow best-practice layout conventions.
- Layout: Generate contract scaffolds with structured layout guidance
- Multiple Template Types: Generate minimal, ERC20 and NFT contract templates
- Custom Headers: Generate standalone comment headers for any section
- Industry Standards: Follows standard Solidity scaffolding conventions
You have to install Rust (latest stable version)
# Clone repo
git clone https://github.com/Joewizy/solStruct.git
cd solstruct
# Build the project
cargo build --release
# Optional: Install globally and use it anywhere on your computer
cargo install --path .
# Example usage
solstruct --template nft# Generate a minimal contract template
cargo run -- --name MyContract
# Generate a simple OpenZeppelin ERC20 contract
cargo run -- --template token
# Generate a simple OpenZeppelin ERC721 contract
cargo run -- --template nft
# Generate a custom header only
cargo run -- --header "Solstruct-Is-Awesome"| Option | Short | Description | Default | Values |
|---|---|---|---|---|
--template |
-t |
Template type to generate | minimal |
minimal, full, token, nft |
--style |
-s |
Comment style for headers | slash |
line, block, asterisk, slash |
--name |
-n |
Contract name | Solstruct |
Any valid contract name |
--output |
-o |
Output filename | Solstruct.sol |
Any valid filename |
--header |
-H |
Generate header only | - | Any text string |
--help |
-h |
Show help information | - | - |
- A simple minimal ERC20 contract from Openzeppelin
Example:
cargo run -- --template token --name MyNFTCollection --token-name Solstruct --token-symbol SLT- A simple ERC721-based NFT contract from Openzeppelin
Example:
cargo run -- --template nft --name MyNFTCollection --token-name Solstruct --token-symbol SLTSolstruct isn't just built for Solidity projects, the --header flag works with any language! Use it to add neat, consistent comment headers to your JavaScript, C++, Python, TOML, Bash files, and more.
# Generate a block-style comment header
solstruct --header "Database-Config" --style block
# Output
==============================
| StateVariables |
==============================
| Style | Description | Example |
|---|---|---|
slash |
Slashes around text | //////// Header //////// |
block |
Box-style framing | ======== Header ======= |
line |
Layered header with title | //////// Header //////// |
asterisk |
Asterisk comment block | /******* Header *****\ |
⚠️ Use hyphens or underscores in headers. Spaces are not supported.
Contributions are welcome — this project is still in its early stages, and your ideas can make a big difference!
- Add new template types (e.g. Governance, Oracle, Bridge, ERC1155)
- Improve and refine existing templates
- Fix bugs or suggest improvements
- Literally any great idea!
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
We'll review your PR and collaborate on getting it merged. Thanks for helping shape solStruct!
Made for the Solidity community
SolStruct - Structure your Solidity code with confidence