Docs
Submit an issue
Smart Contracts
Smart Contracts
  • WELCOME
    • Smart Contracts
    • Installing Pop CLI
    • How to contribute
  • GUIDES
    • Get tokens on Pop (Testnet)
    • Set up your development environment
    • Create a new contract
    • Build your contract
    • Run your unit tests
    • Deploy your contract locally
      • Deploy locally on a Solochain
      • Deploy locally on Pop
    • Call your contract
    • Running E2E tests
    • Deploy on Pop
    • Securely Sign Transactions from CLI
    • Getting Started with ink! v6
  • TUTORIALS
    • Your first ink! smart contract
    • Mint a PSP22 token on Pop
  • POP CLI
    • welcome
    • install
    • new
    • build
    • call
    • up
    • test
    • clean
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. GUIDES

Create a new contract

PreviousSet up your development environmentNextBuild your contract

Last updated 1 month ago

Was this helpful?

⚠️ Note: This guide supports ink! v5 by default. For experimenting with ink! v6, please refer to our .

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 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 ""

Share the StackExchange question in our

migration guide
flipper
https://use.ink/basics/contract-template
Polkadot Stack Exchange
pop
Pop Support Telegram channel