Circular Developer Docs
BuildNetworkGuidesConceptsStandards & ResourcesResources
  • Overview
  • Developer Guides
    • Get Started
    • Install Circular
  • Your first dApp on Circular
    • Introduction to Hyper Code IDE
      • Smart Contract Project Files
      • Project Files
      • CRC_Contract
      • Contract Method
    • Smart Contracts
      • Creating your first smart contract
      • Debugging
      • Deployment
      • Smart Contract Interaction
    • Wallet Access
      • Circular Wallet Architecture
      • Native CRC Wallet
      • Custom Wallet Data
    • Your First Token
      • Simple Token Balance
      • GetBalance Function
      • Drop Function
      • Transfer Function
    • Hyper Code Libraries
      • sha256.hc
      • secp256k1.hc
      • StrUtil.hc
  • Smart Contracts on Circular
    • Smart Contracts (Hyper Code)
      • Get Started
      • Why Hyper Code
      • Compiling
      • Testing
      • Debugging
Powered by GitBook
On this page
  1. Your first dApp on Circular
  2. Smart Contracts

Debugging

At this point, it’s essential to debug the code and ensure all endpoints meet the required specifications. A good approach is to add all relevant endpoints to the Test.hc file for thorough debugging and validation. The file should follow this structure:

CRC_Contract._constructor();

 CRC_Contract.__HelloWorld();
 CRC_Contract.ChangeNumber(100);
 CRC_Contract.ChangeString("Test"); 
 CRC_Contract.__GetNumberInfo();
 CRC_Contract.__GetStringInfo(); 

By adding these debugging endpoints to the Test.hc file, you can thoroughly test and verify your smart contract’s behavior, ensuring it meets all requirements. To start debugging, click the Debug button in Proton IDE, which will activate the tools needed to validate the contract’s functionality.

After successful execution, you’ll see the Contract State displayed in the IDE’s output window as a JSON string. This includes properties like:

  • _MyString with a value of “test.”

  • _MyNumber set to 100.

  • _StringChanger and _NumChanger showing the wallet addresses of those who made changes.

This JSON output offers clear visibility into your contract’s current state, making it easy to track values and interactions.

After the Contract State, the Contract Output will display the results from various endpoints in your smart contract. This section helps diagnose how endpoints are functioning, allowing you to verify that your contract behaves as expected and provides insights into specific actions within your blockchain application.

After the Contract Output, you’ll find the Execution Performance box, showing how long the contract took to execute. In this case, it reports an execution time of 1,280 microseconds.

At this stage, optimizing your code is key. Reducing execution time lowers both gas fees and execution costs, improving your smart contract’s efficiency and cost-effectiveness in blockchain operations.

PreviousCreating your first smart contractNextDeployment

Last updated 7 months ago