Deploy on Celo with Replit
How to deploy a smart contract to Celo testnet, mainnet, or a local network using Replit.
Introduction to Replit
Replit is a coding platform that lets you write code and host apps. It also has many educational features built-in, making it great for teachers and learners too. Every repl you create is a fully functional development and production environment. Hosting from your editor makes it easy to iterate quickly on your work, collaborate with others, and get feedback.
Replit added Solidity to its available programming languages, giving all of the features and functionality Replit provides to Web3 developers creating smart contracts. In this guide, you’ll learn how to make use of these features to build and deploy a smart contract on Celo.
To learn more about the features available to you as a smart contract developer with Replit, visit the Replit documentation.
Prerequisites
To deploy on Celo using Replit, you don’t need any local environment. You should have a wallet available with testnet funds so that you can deploy and test transactions.
If you are new to Replit, it will also help to review the Solidity announcement and Replit documentation.
Create a Repl
After creating your Replit account, your home screen will include a dashboard where you can view projects, create projects, manage your account, and do many other things. You can get started by creating a new Repl.
- Choose + Create Repl from the left panel or + in the top right corner of the screen
- Select the Solidity starter (beta) template and give your project a title
- Click + Create Repl to create your project
Explore the Workspace
By creating a project, you now have a fully functional online IDE that allows you to edit, view, and deploy your smart contracts. It also creates a front-end for your smart contract that you can publish to an easily sharable URL. Read Solidity on Replit for an overview of some of these features.
The README provides an overview of the workspace and gives details on how to make the most of your Replit experience. Read this to help get more familiar with your workspace.
Deploy on Celo
Deploying on Celo with Replit is easy. If you don’t have a wallet with funds, complete Set up a Development Test Wallet so that you are prepared to deploy and interact with your smart contract.
- Select Run to install all relevant packages, start up the contract deployment UI, and compile your contract.sol file
- Select Connect wallet, select your account, then choose Connect.
- Select the contract you would like to deploy from the dropdown (ex. MathTest, SimpleStorage).
- To deploy this contract, select Deploy and confirm the transaction from your wallet.
You can now interact with your contract using the provided user interface or from a sharable URL shown on the interface.
Verify Contract Deployment
To view your deployed contract, copy your account address navigate to the Celo explorer, and search for your account (verify that you are searching the correct network).
- View the most recently deployed contract to find additional information on your deployment.
Learn more about exploring the Celo network and smart contract details in BlockScout here.