Home

Awesome

diamondscaffold

diamondscaffold is a CLI tool that helps developers scaffold an EIP-2535 diamond structure with ease. Users can choose between Hardhat or Foundry as their development environment, and they can select between templates like "ERC20", "ERC721", or a default Diamond template to kickstart their smart contract development.

Screenshot

Features

Installation

You can install the package globally via npm to use it as a CLI tool.

npm install -g diamondscaffold

Usage

Once installed, use the diamonds init command to scaffold an EIP-2535 Diamond structure.

Basic Command

diamonds init

This command will prompt you with several questions to help set up your project. Here's the sequence of questions asked:

  1. Project Name: The name of your project (default is my-app).
  2. Template: Choose a template to scaffold: Default, ERC20, or ERC721.
  3. Framework: Choose between Foundry or Hardhat.
  4. Language (only for Hardhat): Choose between JavaScript or TypeScript.
  5. Install Dependencies (only for Hardhat): Option to install dependencies automatically, provided you have an active internet connection.

Example

diamonds init

During the initialization, you will be prompted with questions like:

šŸ“ What is the name of your project? (default: my-app)
šŸ“‘  What Template would you like to scaffold? (choices: Default, ERC20, ERC721)
šŸ”§ Which framework would you like to use? (choices: Foundry, Hardhat)
šŸ“š Which language do you want to use? (choices: JavaScript, TypeScript)
Do you want to install project dependencies? (only for Hardhat)

To scaffold a diamond project using Hardhat, ERC20, and TypeScript with automatic dependency installation:

diamonds init

Available Templates

  1. ERC20: A diamond contract implementing the ERC20 token standard.
  2. ERC721: A diamond contract implementing the ERC721 NFT standard.
  3. Default: A basic diamond structure with no additional functionality, providing a clean slate to start with.

Commands

Hardhat Commands

If you scaffold with Hardhat, these commands will be available:

Foundry Commands

If you scaffold with Foundry, these commands will be available:

Contribution

Contributions to diamondscaffold are welcome! If you'd like to contribute checkout:

  1. Contribution guildlines
  2. Git guildlines
  3. Issues guildlines

License

This package is licensed under the MIT License. See the LICENSE file for more information.