cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

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

Open Robbepop opened this issue 4 years ago • 1 comments

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.

Robbepop avatar Mar 02 '21 13:03 Robbepop

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

HCastano avatar Aug 04 '21 19:08 HCastano