How to Deploy a Smart Contract
This guide provides instructions on deploying a sample ERC20 smart contract on the Columbus test network.
Camino Builder: Your Gateway to Smart Contract Development
The Camino Builder repository is your comprehensive guide to developing smart contracts on Camino Network's C-Chain. Perfect for both beginners and experienced developers, it offers:
- Step-by-Step Tutorials for creating NFTs, token-gated access, KYC-compliant contracts, tokens, and staking systems
- Ready-to-Use Project Template with pre-configured Hardhat setup
- Security Best Practices and challenge exercises
- Testing Frameworks and guides for writing robust tests
- Detailed Theory Sections to understand the underlying concepts
- Front-end Integration guides to build complete dApps
Whether you're building the next travel industry innovation or learning blockchain development, Camino Builder provides all the tools and knowledge you need to get started.
Repository: https://github.com/chain4travel/camino-builder
Get support on Discord #tech-support channel!
Requirements
- KYC-verified wallet: Only KYC-verified accounts are allowed to deploy smart contracts on the Camino Network.
- Funds in C-Chain Address: Ensure that you have CAM tokens in your C-Chain address. You can acquire some tokens through the faucet on the Discord channel.
- MetaMask Wallet: Configure your MetaMask wallet to connect with the Columbus network and your account.
Overview
- Create a wallet.
- Complete the KYC verification process.
- Request funds from the Discord faucet.
- Perform a cross-chain transfer between the X-Chain and C-Chain.
- Add your account and the Columbus network to the MetaMask wallet.
- Access the Remix IDE & Import a sample ERC20 contract.
- Compile the contract.
- Provide the necessary details and deploy the contract.
- Add your newly created token to MetaMask and the Camino Wallet.
1. Create a Wallet
To create a Camino Wallet, please follow the instructions provided in the How to Create a Wallet documentation page.
If you already have a wallet, you can proceed to the next step.
2. KYC Verification
Ensure that your account is KYC-verified. To complete the KYC verification process, refer to the KYC Verification documentation page.
If your account is already KYC-verified, you can skip this step.
3. Request Funds from the Discord Faucet
To request funds from the Discord faucet, visit the Camino Discord server and follow the instructions below.
To request funds from the Discord faucet, follow these steps:
- Join the Camino Discord server and navigate to the Community > General channel.
- Type
/faucet
in the chat. The user interface will update to reflect the changes, similar to the screenshot provided. - Copy and paste your X-Address from the Camino Wallet.
- Enter the amount of CAM you wish to request, separating the command, X-Address and the requested amount with spaces.
Please note that there is a limit of 150 CAM that can be requested within a 1-week period.
The daily faucet limit is subject to change. Always check the faucet for the current limit. If your request exceeds the limit, the faucet will notify you.
In approximately one to two minutes, you should receive the requested amount of CAM in your Camino Wallet. Verify this in your Camino Wallet interface.
Once the funds are received in your Camino Wallet, they will be on the X-Chain and you will need to transfer them to the C-Chain in order to use them for smart contract deployment.
4. Perform Cross-Chain Transfer
- Click on "Cross Chain" in the navigation bar of the Camino Wallet.
- Select "X" as the Source Chain and "C" as the Destination Chain.
- Enter the desired amount in the Transfer Amount field and click "Confirm".
Finally, click "Transfer" to initiate the cross-chain transfer.
If you wish to view detailed information about your balance on different chains, you can click the "Show Breakdown" button located on the right-hand side of the balance display.
Transfer is successful.
5. Add Your Account and the Columbus Network to the MetaMask Wallet
To add your account and the Columbus Network to your MetaMask wallet, please follow the instructions provided in the MetaMask & RPC Endpoints documentation page.
6. Access the Remix IDE & Import a Sample ERC20 Contract
Go to the Remix IDE URL: https://remix.ethereum.org/
On the Remix IDE page, locate and click on the "OXPROJECT ERC20" to import the sample ERC20 contract.
7. Compile the Contract
After importing the necessary files into your workspace, select the "SampleERC20.sol" file.
- To compile your contract, navigate to the "Solidity Compiler" tab in the Remix IDE.
- Choose the appropriate compiler version. In this case, select v0.5.17.
- Click on the drop down menu "Advanced Configurations" and select "paris" as EVM version.
- Click on the "Compile SampleERC20.sol" button to initiate the compilation process.
Please choose the EVM version "paris" from Advanced Configurations section.
8. Provide the Necessary Details and Deploy the Contract
- Choose "Injected Provider - MetaMask" from the Environment dropdown menu.
- Click on the arrow on the right side of the "Deploy" button to expand the menu.
- Enter your desired values for NAME, SYMBOL, DECIMALS, and TOTALSUPPLY.
In the example provided below, we used
9
decimals and1000000000000000
to mint 1 million tokens. - Once you have filled in the required details, click on the "transact" button to proceed.
- Once your contract is deployed, click on the contract to expand the menu located at the bottom left-hand side.
- Copy and save the contract address. To do this, click on the copy button positioned on the right side of the contract, under the deployed contracts section. This contract address will be required when adding your token to wallets.
9. Add Your Newly Created Token to MetaMask and the Camino Wallet.
Congratulations, you have your own token! Let's add your token to MetaMask and Camino Wallet.
Add Your Token to the Camino Wallet
- Open your wallet and navigate to the Portfolio page.
- Locate & click the "Add Token" button at the bottom of the Assets section.
- Paste the contract address into the "Token Contract Address" field.
- Click on "Add Token" to proceed.
- Your token will be successfully added to your wallet. Now, you can send it to your friends. :)
Add Your Token to the MetaMask Wallet
- At the bottom of the window, click on "Import tokens."
- Paste your contract address, and the remaining fields will be automatically filled in.
- Click "Import tokens"
- Enjoy using your new token on MetaMask!