This guide will show you how to deploy any smart contract to the Canto network.
By the end, you'll learn how to create a simple Edition Drop smart contract, deploy it to the Canto Testnet, and mint an NFT on the smart contract.
Let's get started!
What is Canto?
Canto is a permissionless general-purpose blockchain running the Ethereum Virtual Machine (EVM). It was built to deliver on the promise of DeFi – that through a post-traditional financial movement, new systems will be made accessible, transparent, decentralized, and free.
Create a smart contract on Canto
To begin, head to the Contracts page in your thirdweb Dashboard and hit "Deploy new contract":
You will be taken to our Explore page — where you can browse smart contracts built by the top protocols in web3 and deploy them in just a few clicks!
Note: You can also use the thirdweb CLI to set up a smart contract environment by running the below command from your terminal:
npx thirdweb create contract
This will take you through an easy-to-follow flow of steps for you to create your contract. Learn more about this in our CLI guide.
Otherwise, let's get back to Explore:
Here, select your smart contract of choice. For this guide, we're going to use the Edition Drop (ERC1155) contract to create our NFT collection:
Set up your smart contract with an image, name, description, etc., and configure which wallet address will receive the funds from primary and secondary sales:
Our smart contracts are deployable to any EVM chain, so let's deploy this to the Canto Testnet!
Add the Canto Testnet network to your dashboard & wallet
To deploy a smart contract to Canto we first need to add it as a network to the Dashboard.
To do this, click on the chain dropdown.
Search for "Canto" and select Canto Testnet:
Once you have selected the network. This will prompt you to switch your network to Canto Testnet.
Now, let's deploy the smart contract on the Canto Testnet! But before that, we need testnet funds.
Get Canto Testnet funds in your wallet
Once you have added the Canto Testnet to your wallet, we can request funds from the Canto Testnet Faucet. So, go to the faucet, paste in your address and click on "Request Funds":
Once you click on request funds you should receive this dialogue box saying transaction successful:
If you go ahead and check your wallet, you will see that the funds have arrived in your wallet:
Deploying the contract on Canto
Now that you have your testnet funds, let's go back to the thirdweb Dashboard where we were building our Edition Drop contract.
We have already filled out the metadata so click on "Deploy Now" after selecting the chain. It will prompt a transaction, you have to approve that.
And you're done! You have just deployed to the Canto Testnet.
Calling Smart Contract Functions
Let's see how we can use the smart contract by calling some functions on it, such as minting an NFT into our collection!
Explorer tab, you can view all of the available functions on your smart contract and execute them directly from your connected wallet:
Setting Up Our NFT Collection
In our example, we created an Edition drop smart contract, so we'll quickly set it up and mint our first NFT by performing the following steps:
Once we've set up our NFTs, we can click the
Claim button in the
NFTs tab to mint our first NFT, and voilà! We just minted an NFT on the Avalanche Fuji Testnet!
Now that you've deployed your smart contract, you can use our SDK to build a web3 application! Where users can connect their wallets and interact with the functions of your smart contracts. Learn more from our guide below:
In this guide, you've learned how to create a simple Edition Drop smart contract, deploy it to the Canto Testnet, and mint an NFT on the smart contract. We hope it was helpful!
If you have any questions jump into the thirdweb Discord and join 32,000+ other builders! And if you're looking to build on Canto and want to learn more about how to do that with thirdweb's tools, reach out to the team directly. Please let us know if you have any feature requests or guide requests here.