Skip to content

Joewizy/solStruct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SolStruct 🏗️

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.

Features ✨

  • 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

Installation 🚀

Prerequisites

You have to install Rust (latest stable version)

Setup

# 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

Quick Start 🏃‍♂️

# 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"

Command Line Options

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 - -

Templates

ERC20 Template (--template token)

Example:

cargo run -- --template token --name MyNFTCollection --token-name Solstruct --token-symbol SLT

NFT Template (--template nft)

Example:

cargo run -- --template nft --name MyNFTCollection --token-name Solstruct --token-symbol SLT

🧩 Headers for Any Language

Solstruct 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       |
==============================

🔧 Supported Styles

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.

Contributing 🤝

Contributions are welcome — this project is still in its early stages, and your ideas can make a big difference!

Ways to Contribute

  • Add new template types (e.g. Governance, Oracle, Bridge, ERC1155)
  • Improve and refine existing templates
  • Fix bugs or suggest improvements
  • Literally any great idea!

How to Contribute

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add some amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. 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

About

SolStruct is 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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages