ACADEMY

v2

MODULE 14

LESSON 2

Writing Qubic Smart Contracts

Qubic separates read-only Functions from state-changing Procedures:

Functions

Query the contract’s state without writing. Called through RCF (Request Contract Function) messages; they don’t enter the blockchain.

Procedures

Perform updates. Triggered by a transaction and executed during the next tick.

Think of Functions as Ethereum “view” calls and Procedures as regular transactions — except Qubic enforces the separation at the language level.

Example (from repo):

FUNCTION greet() {
    return greeting;
} 
PROCEDURE setGreeting(const char* newGreeting) {
    greeting = newGreeting;
}

© 2025 Qubic.

Qubic is a decentralized, open-source network for experimental technology. Nothing on this site should be construed as investment, legal, or financial advice. Qubic does not offer securities, and participation in the network may involve risks. Users are responsible for complying with local regulations. Please consult legal and financial professionals before engaging with the platform.

© 2025 Qubic.

Qubic is a decentralized, open-source network for experimental technology. Nothing on this site should be construed as investment, legal, or financial advice. Qubic does not offer securities, and participation in the network may involve risks. Users are responsible for complying with local regulations. Please consult legal and financial professionals before engaging with the platform.