3 unstable releases
new 0.1.1 | Dec 20, 2024 |
---|---|
0.1.0 | Dec 20, 2024 |
0.0.1 | Dec 18, 2024 |
#269 in Magic Beans
113 downloads per month
105KB
2.5K
SLoC
DotKit
A Scaffolding Tool for Ink Smart Contracts
DotKit is a powerful scaffolding tool designed to help you quickly generate basic templates for ink! smart contracts. Whether you're building a Counter, NFT, Token, or Multisig contract, DotKit provides a streamlined way to kickstart your project, allowing you to focus on the specifics of your use case.
With DotKit, you can:
- Select a contract type based on your needs.
- Customize basic details such as project name, author name, and email.
- Generate a ready-to-use ink! contract with minimal effort.
Features
- Interactive CLI: DotKit guides you through a simple, interactive process to gather required details.
- Supported Contract Types:
- Counter Contract: A basic increment/decrement counter.
- NFT Contract: A template for non-fungible token standards.
- Token Contract: A starting point for creating fungible tokens.
- Multisig Contract: A contract for managing multisignature wallets.
- Sensible Defaults: Defaults for inputs like project name and author details ensure you can get started even faster.
- Validated Inputs: Input validation ensures your data is accurate before generating the contract.
Installation
-
Clone the repository:
cargo install dotkit
-
Build the project:
cargo contract build --release
Usage
-
Run DotKit:
dotkit
-
Follow the interactive prompts to:
- Enter your project name.
- Enter your name and email.
- Select a contract type.
-
Once complete, DotKit will generate a new folder with the scaffolded contract files.
Example
Here’s an example of using DotKit to generate a Counter contract:
-
Run the tool:
dotkit
-
Input the details when prompted:
Enter your project name: counter_project Enter your name: Alice Enter your email: alice@example.com Pick a project type: - [c] Counter Contract - [t] Token Contract - [n] NFT Contract - [m] Multisig Contract Select an option: c
-
DotKit will generate the contract and display:
Let's cook!🚀 1. Open `lib.rs` 2. Make some required changes 3. Run `cargo contract build` to build the contract"
-
Navigate to the generated folder:
cd counter_project
-
Open
llib.rs
file and adjust the generated contract file as needed.
Project Structure
The scaffolded project will have the following structure:
project_name/
├── lib.rs # Main ink! contract file
├── Cargo.toml # Rust project file
└── README.md # Project README file
Roadmap
- MVP with basic contract types
- Add support for additional contract types.
- Audit contracts
- Provide more customization options for generated contracts.
- Integrate with popular blockchain development tools.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests. See the CONTRIBUTING.md file for more details.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
Special thanks to the ink! development community for their fantastic tools and support.
Dependencies
~10–19MB
~262K SLoC