use-ink / cargo-contract

Setup and deployment tool for developing Wasm based smart contracts via ink!
GNU General Public License v3.0
254 stars 119 forks source link

Maybe add `cargo contract template` command to create templated contracts #207

Open Robbepop opened 3 years ago

Robbepop commented 3 years ago

People are often confused about how cargo contract new flipper creates a proper flipper ink! smart contract while cargo contract new erc20 does not create a proper ERC-20 contract. This is intentional and also we cannot solve the problem of inferring logic and code of what people have in mind when they write up some name for a smart contract, e.g. flipper, erc20 or whatever.

Also the cargo contract new command deliberately mimics the cargo new command. Instead what we could do is to provide yet another cargo contract command called template that provides to create a new ink! smart contract template from a given variety of predefined templates. These could include flipper, erc20, erc721, multi-sig etc.

HCastano commented 3 years ago

Random thought: It would be cool to have a way to choose between different contract templates. E.g, do you want to use an ink! provided template, or maybe a template from (for example) OpenZeppelin