Create a new contract
⚠️ Note: This guide supports ink! v5 by default. For experimenting with ink! v6, please refer to our migration guide.
To create a smart contract with Pop CLI:
pop new contract
The above command will guide you through an interactive prompt to create a new smart contract:
┌ Pop CLI : Generate a contract
│
◆ Select a template type:
│ ● Examples (Contract examples for ink!. 4 available option(s))
│ ○ ERC
│ ○ PSP
└
Notice that there are several templates available.
To get a full list of available templates run pop new contract --help
You can also create a new smart contract manually (without interactivity):
pop new contract my_contract
Note: this will create a contract using the default template which is based on the
flipper
contract example.
You should get output like the following:
┌ Pop CLI : Generating new contract "my_contract"!
│
◇ Smart contract created! Located in the following directory "/my_contract"
│
└ cd into "my_contract" and enjoy hacking! 🚀
You can now cd
into the folder and start hacking on your contract:
cd my_contract
You should see the directory structure of your ink! smart contract:
my_contract
└─ lib.rs
└─ Cargo.toml
└─ .gitignore
Several options are available when creating a smart contract manually.
To see all the available options, run pop new contract --help
For example:
pop new contract my_contract --contract-type erc --template erc721
Further Reading Material
Technical Support
Create a question and tag it with "
pop
"Share the StackExchange question in our Pop Support Telegram channel
Last updated
Was this helpful?