Skip to main content

How to Deploy a Smart Contract

This guide provides instructions on deploying a sample ERC20 smart contract on the Columbus test network.

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

  1. Create a wallet.
  2. Complete the KYC verification process.
  3. Request funds from the Discord faucet.
  4. Perform a cross-chain transfer between the X-Chain and C-Chain.
  5. Add your account and the Columbus network to the MetaMask wallet.
  6. Access the Remix IDE & Import a sample ERC20 contract.
  7. Compile the contract.
  8. Provide the necessary details and deploy the contract.
  9. 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:

  1. Join the Camino Discord server and navigate to the Community > General channel.
  2. Type /faucet in the chat. The user interface will update to reflect the changes, similar to the screenshot provided.
  3. Copy and paste your X-Address from the Camino Wallet.
  4. 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 50 CAM that can be requested within a 24-hour period.

Fig.1: Request funds from the faucet

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.

Fig.2: Funds requested!

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.

Fig.3: Funds received!

4. Perform Cross-Chain Transfer

  1. Click on "Cross Chain" in the navigation bar of the Camino Wallet.
  2. Select "X" as the Source Chain and "C" as the Destination Chain.
  3. Enter the desired amount in the Transfer Amount field and click "Confirm".
Fig.4: Fill in the form and confirm

Finally, click "Transfer" to initiate the cross-chain transfer.

Fig.5: Click Transfer
tip

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.

Fig.6: 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.

Fig.7: Remix IDE

7. Compile the Contract

After importing the necessary files into your workspace, select the "SampleERC20.sol" file.

Fig.8: Import Files
  • 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.
Fig.9: Contract Compiled
DON'T FORGET TO SET EVM VERSION TO "PARIS"

Please choose the EVM version "paris" from Advanced Configurations section.

Choose "paris" as the EVM version

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 and 1000000000000000 to mint 1 million tokens.
  • Once you have filled in the required details, click on the "transact" button to proceed.
Fig.10: Fill in the details and deploy
  • Once your contract is deployed, click on the contract to expand the menu located at the bottom left-hand side.
Fig.11: Click on the deployed contract
  • 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.
Fig.12: Copy the contract address

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.
Fig.13: Add your token to Camino Wallet
  • Your token will be successfully added to your wallet. Now, you can send it to your friends. :)
Fig.14: Enjoy your new token!

Add Your Token to the MetaMask Wallet

  • At the bottom of the window, click on "Import tokens."
Fig.15: Click "Import tokens"
  • Paste your contract address, and the remaining fields will be automatically filled in.
Fig.16: Paste contract address
  • Click "Import tokens"
Fig.17: Click Import tokens
  • Enjoy using your new token on MetaMask!
Fig.18: Enjoy!