truffle-plugin-creator
v0.0.5
Published
Truffle Plugin which allow you create new contracts with all related stuff
Downloads
6
Readme
This truffle plugin allows you to automatically create contracts with related stuff like migrations, tests ets.
Installation
Install the plugin with npm
npm install --save-dev truffle-plugin-creator
Add the plugin to your
truffle.js
ortruffle-config.js
filemodule.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>
| Option | Value | Meaning | |---------|---------| ---------| | --test | sol | (def value) Generate *.sol file as a test | | | js | Generate *.js file as a test | | | both | Generate *.js file as a test as well as *.sol file | | | none | Skip test creation | | --migration | new | (def value) Put a contract to a new migration file | | | current | Put a contract to the existing migration file | | | none | Skip migration creation | | --constr | true | (def value) Create a constructor for the contract | | | false | Don'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