0.0.5 • Published 5 years ago

truffle-plugin-creator v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

This truffle plugin allows you to automatically create contracts with related stuff like migrations, tests ets.

Installation

  1. Install the plugin with npm

    npm install --save-dev truffle-plugin-creator
  2. Add the plugin to your truffle.js or truffle-config.js file

    module.exports = {
      /* ... rest of truffle-config */
    
      plugins: [
        'truffle-plugin-creator'
      ]
    }

Usage

You can create a bunch of contracts like:

truffle run create <Contract1> <Contract2> <ContractN> <options here>
OptionValueMeaning
--testsol(def value) Generate *.sol file as a test
jsGenerate *.js file as a test
bothGenerate .js file as a test as well as .sol file
noneSkip test creation
--migrationnew(def value) Put a contract to a new migration file
currentPut a contract to the existing migration file
noneSkip migration creation
--constrtrue(def value) Create a constructor for the contract
falseDon't create a constructor for the contract
--sol-min(def value = 0.4.22) Minimum version of solidity
--sol-max(def value = 0.6.0) Maximum version of solidity

How to extend functionality of the plugin

In order to extend functionality and generate something else you can create new generator and put it to one of the arrays inside creator.js

There are 2 kinds of generators:

  • regular: is used to generate something for each contract
    • arguments are contract and config
  • collection: is used to generate something for all contracts at once
    • arguments are contract and config
0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago