Qubetics Docs
  • Getting Started
    • Quickstart
    • Network Architechture
    • Qubetics: TICS Token
    • Add Qubetics Network
    • Get TICS tokens
    • Testnet Node Setup
      • How To Become a Validator
    • Validator Application: User Guide
      • Validator Login
      • Validator Dashboard
      • Setup as a Validator
      • Blocks Page
      • Validators
        • Active Validators Tab
        • Inactive Validator Tab
        • Deactivated Validator Tab
      • Validator Details
      • Manage Account
        • Profile Details
          • Bond More Funds
          • Unbond Funds
          • Stop Validator
    • How To Become a Delegator
    • Delegator Application: User Guide
      • Login
      • Dashboard
        • Bond More Funds
        • Unbond Funds
        • Redelegate Funds
      • Wallet Activities
      • Setup Delegator Bond
      • All Validators
      • Validator Details Page
    • TICS Scan User Guide
      • Dashboard
      • Block Summary
      • Block Details
      • Transactions Summary
      • Transaction Details
      • Address Detail
      • Tokens
      • Validators
      • Nodes
        • Node Sync
      • Contract List
      • Contract Detail
        • Transaction Tab
        • Transfers Tab
        • Holders Tab
        • Event Tab
        • Contract Tab
          • Read Contract Tab
          • Write Contract Tab
        • Analytics Tab
      • Contract Verification
      • Token Icon
      • Faucet
    • Qubetics IDE User Guide
    • QubeQode Basic User Guide
      • Workspace
      • Compile
      • Deploy
  • QubeQode Pro User Guide
    • Choose your plan
    • Start Chat
      • Generated Code Preview
      • Deploy Step-1
      • Generated Code
    • Settings
  • Basics
    • Editor
    • Markdown
    • Images & media
    • Interactive blocks
    • OpenAPI
    • Integrations
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • Steps to add Qubetics Network in Metamask Wallet
  • Part 1: Connecting to the Qubetics Network
  • Part 2: Deploying Contracts Using Qubetics IDE
  • Verifying the Contract on TICS Scan
  • Step 1: Enter Contract Details
  • Step 2: Upload Contract Source Code
  • Troubleshooting Verification Errors
Export as PDF
  1. Getting Started

Qubetics IDE User Guide

How to Deploy Contract on Qubetics IDE

PreviousFaucetNextQubeQode Basic User Guide

Last updated 1 month ago

Introduction

This guide provides step-by-step instructions to deploy any smart contract on the Qubetics blockchain. You’ll learn how to set up your development environment, write and compile the contract, and deploy it using the Qubetics IDE.

Prerequisites

Before you start, ensure you have:

  • Basic knowledge of Solidity and smart contracts.

  • A EVM-compatible wallet such as metamask with Quebtics blockchain network.

Steps to add Qubetics Network in Metamask Wallet

  1. Open Metamask: Launch the Metamask extension

  1. Access Network Settings:

  • Click on the Network Selector dropdown at the top of the Metamask interface (usually showing "Ethereum Mainnet" by default).

  • Select "Add Network" or "Add a Network Manually".

  1. Add a Custom RPC Network: In the "Add a network" screen, click "Add a network manually" to input the custom details.

  2. Fill in Network Details Enter the required blockchain network information:

  • Network Name: Qubetics Testnet.

  • RPC URL: The endpoint URL for the blockchain for Testnet: “https://rpc-testnet.qubetics.work“

  • Chain ID: The unique ID for the Qubetics blockchain (9029).

  • Currency Symbol: The native token symbol (TICS).

  • Tools: Qubetics IDE.

Part 1: Connecting to the Qubetics Network

To add Qubetics network in the metamask, there are 2 options:

k Connect MetaMask to Qubetics Network

Method 2: Manually Adding Network Alternatively, if you want to add the network manually, ensure your MetaMask is upgraded to version 12.9.2 or higher. Enter the following details in MetaMask:

  • Network Name: Qubetics Testnet

  • Default RPC URL: https://rpc-testnet.qubetics.work

  • Chain ID: 9029

  • Currency Symbol: TICS

  • Confirm Connection: Once the network is added, your MetaMask wallet will connect to the Qubetics blockchain. Ensure you can see your wallet address and balance.

Part 2: Deploying Contracts Using Qubetics IDE

  1. Open Qubetics IDE

  • To open the File Explorer module, click on the Workspace option in the left-side menu. The File Explorer helps you manage your workspaces and files easily.

  • You can also right-click on any file or folder to see a menu with quick options for different actions.

  1. Create a New File

  • In the Qubetics IDE dashboard, click on "New File" and name it MyContract.sol.

  • Write or paste your Solidity smart contract code into the editor.

Code for ERC-20:

// contracts/GLDToken.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract GLDToken is ERC20 {

constructor(uint256 initialSupply) ERC20("Gold", "GLD") {

_mint(msg.sender, initialSupply);

}

}

Code for ERC-721:

// contracts/GameItem.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";

import "@openzeppelin/contracts/utils/Counters.sol";

contract GameItem is ERC721URIStorage {

using Counters for Counters.Counter;

Counters.Counter private _tokenIds;

constructor() ERC721("GameItem", "ITM") {}

function awardItem(address player, string memory tokenURI)

public

returns (uint256)

{

uint256 newItemId = _tokenIds.current();

_mint(player, newItemId);

_setTokenURI(newItemId, tokenURI);

_tokenIds.increment();

return newItemId;

}

}

Code for ERC-1155:

// contracts/GameItems.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

contract GameItems is ERC1155 {

uint256 public constant GOLD = 0;

uint256 public constant SILVER = 1;

uint256 public constant THORS_HAMMER = 2;

uint256 public constant SWORD = 3;

uint256 public constant SHIELD = 4;

constructor() ERC1155("https://game.example/api/item/{id}.json") {

_mint(msg.sender, GOLD, 10**18, "");

_mint(msg.sender, SILVER, 10**27, "");

_mint(msg.sender, THORS_HAMMER, 1, "");

_mint(msg.sender, SWORD, 10**9, "");

_mint(msg.sender, SHIELD, 10**9, "");

}

}

  1. Set the Compiler Version

  • Navigate to the "Solidity Compiler" tab on the left sidebar.

  • Choose the compiler version matching the pragma solidity version in your contract, e.g., 0.8.26+commit.8a97fa7a.

  • Expand the "Advanced Configurations" dropdown and set the following:

    • Language: Solidity

  1. Compile the Contract Click "Compile MyContract.sol" to ensure there are no syntax or configuration errors.

  2. Set Up for Deployment

  • Go to the "Deploy & Run Transactions" tab.

  • Under "Environment", select "Injected Provider - MetaMask" to connect your wallet.

  1. Deploy the Contract

  • For an ERC-72/ERC-1155 contracts, click "Deploy" directly.

  • For an ERC-20 contract, input the wallet address in the field next to the Deploy button. This address will also act as the contract owner.

Verifying the Contract on TICS Scan

Navigate to the Verification Section

  • Open the TICS Scan.

  • Select "Contract List" from the navbar.

  • Locate and click on the deployed contract address to open its details page. “0x386559f6a6C00E99ff18733416B297cA6e9EAb38”

  • Click the "Verify & Publish" button to proceed.

Step 1: Enter Contract Details

  • The contract address will be pre-filled.

  • Complete the following fields:

    • Compiler Type: Select "Solidity - Single File".

    • Compiler Version: Choose the version used during deployment (e.g., 0.8.26+commit.8a97fa7a).

    • License Type: Choose the open-source license type (e.g., "MIT").

  • Agree to the Terms of Service and click "Next".

Step 2: Upload Contract Source Code

  • Convert your MyContract.sol file into a flattened version:

    • Right-click on MyContract.sol and select "Flatten" to generate a file named MyContract_flattened.sol.

  • Copy the flattened code and paste it into the "Upload Contract Source Code" field.

Miscellaneous Settings

  • Expand "Misc Settings (Runs, EVM Version Settings)" and set:

    • EVM Version: London

  • Click "Done" and Submit.

  • A prompt will confirm that the verification has been initialized.

Review Verification Status

  • Return to the "Contract List" on the Explorer and select the verified contract address.

  • The verification status will display one of the following:

    • Verified: The contract is successfully verified.

    • Partially Verified: The contract is partially verified.

    • Rejected Verification: The verification failed (e.g., ByteCode mismatch).

Troubleshooting Verification Errors

If the verification fails, review the error message, correct the indicated issue (e.g., mismatch in the compiler version), and repeat the process.

Congratulations! Your contract is now deployed and verified on the Qubetics chain and ready for use.

Open the Qubetics Explorer.

Click on "Add Qubetics Network" to automatically connect your wallet to the Qubetics blockchain.

Visit Qubetics IDE IDE, link:

EVM Version: London

Ensure your MetaMask wallet is connected to the Qubetics Network and displays the account address and available balance.

Click "Deploy" and confirm the transaction in MetaMask.

Once deployed, the contract address will appear in the Qubetics IDE terminal.

https://qubetics-ide.qubetics.work