The Deploy Tab simplifies the deployment process for smart contracts, making it user-friendly and efficient. Here's how to navigate and use this section:
Step 1: Connect MetaMask Establishes a secure connection between your MetaMask wallet and QubeCode for seamless deployment. Click the "Connect With MetaMask" button to link your wallet. Ensure that MetaMask is installed in your browser and you are logged in.
Step 2: Compile Your Contract
Ensure your contract is error-free and compiled successfully in the Compile Tab before proceeding to deployment.
Step 3: Deploy the Contract
Once connected to MetaMask, click the Deploy button. Confirm the transaction in MetaMask to initiate deployment.
Wait for the deployment process to complete. A transaction hash will be generated, and the Contract Address field will populate with the address.
Note: Ensure that your MetaMask wallet has sufficient funds for gas fees.
Step 4: Verify and Publish
Click the Verify & Publish button after deployment. This action validates your contract’s source code and publishes within QubeQode and user don't need to verify the contract on TICSScan, allowing users to interact with and review the contract within QubeQode.
Check Gas Fees: Always ensure your wallet has enough funds to cover gas fees for deployment.
Network Selection: Double-check that the selected network in MetaMask matches the intended deployment network.
Save the Address: After deployment, save your contract address for future reference or integration.
Work Space Navigation Panel
Located on the left-hand side, this panel provides quick navigation between the following key actions:
Work Space: The main area where you define and customize your smart contract.
Compile: Allows you to compile the smart contract to identify syntax or logical errors.
Deploy: Facilitates the deployment of the compiled contract to the blockchain.
Contract Categories
At the top of the workspace, you can choose from various contract types:
ERC20: For creating fungible tokens.
ERC721: For creating non-fungible tokens (NFTs).
ERC1155: For multi-token standards.
Stablecoin: For creating pegged assets.
Real-World Asset: For tokenizing tangible assets.
Governor: For building governance contracts.
Custom: For creating custom smart contracts.
Settings Panel
Located on the left side of the workspace, this section allows you to customize your smart contract with various options:
Name and Symbol: Specify the token's name and symbol (e.g., "My Token," "MTK").
Pre-mint: Define the initial supply of tokens to be minted upon contract creation.
Features:
Mintable: Enables token minting after deployment.
Burnable: Allows token holders to burn (destroy) tokens.
Pausable: Adds the ability to pause contract functionality in certain scenarios.
Permit: Enables gasless approvals using EIP-2612.
Flash Minting: Supports flash loans with immediate repayment.
Voting Options:
Block Number: Voting based on blockchain block numbers.
Timestamp: Voting based on timestamps.
Access Control:
Ownable: Grants ownership-based access control.
Roles: Enables role-based permissions for contract management.
Managed: Allows for advanced management of contract functionalities.
Upgradeability: Adds support for upgradable contracts.
Code Editor
The central area displays the generated Solidity code based on the selected options in the settings panel.
Users can preview, edit, or copy the code for further modifications.
The editor includes comments and import statements for necessary libraries like ERC20
and ERC20Permit
.
Download Button
Located in the top-right corner, the "Download" button lets you export the generated Solidity code file for external use.
Choose a Contract Type
Select the desired contract type (e.g., ERC20) from the tabs at the top.
Configure Contract Settings
Enter the Name and Symbol for your token.
Adjust additional settings like pre-minting, mintability, burnability, and more, depending on your use case.
Customize Access Control and Voting
Enable access control mechanisms such as ownership or roles.
Configure voting mechanisms based on block numbers or timestamps if applicable.
Preview and Edit the Code
Review the generated Solidity code in the editor.
Make manual changes if necessary to meet advanced or unique requirements.
Download the Code
Once satisfied with the contract, click the "Download" button to save the Solidity file for further compilation or deployment.
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 QubeQode Basic.
Before you start, ensure you have:
Basic knowledge of Solidity and smart contracts.
A EVM-compatible wallet such as metamask with Quebtics blockchain network.
Open Metamask: Launch the Metamask extension
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".
Add a Custom RPC Network: In the "Add a network" screen, click "Add a network manually" to input the custom details.
Fill in Network Details Enter the required blockchain network information:
Network Name: Qubetics Testnet or Qubetics Privnet.
RPC URL: The endpoint URL for the blockchain for Devnet: “alphatestnet-evm-rpc.qubetics.work“
Chain ID: The unique ID for the Qubetics blockchain (9003).
Currency Symbol: The native token symbol (TICS).
Tools: QubeQode Basic.
To add Qubetics network in the metamask, there are 2 options:
Method 1: To add the network with single click 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://alphatestnet-evm-rpc.qubetics.work
Chain ID: 9003
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.
The Compile Tab is designed to simplify the compilation process for smart contracts. It ensures compatibility with different Solidity versions and Ethereum Virtual Machine (EVM) configurations, giving developers flexibility and control.
1. Select Contract Type
At the top, you will find options for different contract types such as ERC20, ERC721, ERC1155, Stablecoin, Real-World Asset, Governor, and Custom.
Click on the desired contract type to load the associated code template.
2. Configure Solidity Compiler
Compiler Dropdown:
Choose the Solidity compiler version compatible with your contract requirements (e.g., 0.8.22
or 0.8.19
).
The dropdown allows you to select the compiler version for compatibility with various blockchain networks.
EVM Version Dropdown:
Select the EVM version (e.g., London, Istanbul) to ensure the contract complies with the target blockchain specifications.
3. View and Edit Code
The main editor displays the Solidity code for your selected contract template.
You can modify the code directly in the editor to customize parameters such as:
Token Name
Symbol
Premint Amount
Additional contract functionality.
4. Compile the Contract
Once you have configured the settings and edited the code:
Click the Compile button to generate the bytecode and ABI (Application Binary Interface).
A progress indicator will show the compilation status.
Successful Compilation:
If the contract compiles successfully, the interface will display the output.
Errors or warnings will be highlighted in the editor for easy debugging.
Open the Qubetics Explorer.
Click on "Add Qubetics Network" to automatically connect your wallet to the Qubetics blockchain.