Quickstart

In a few steps, you can have your first SCL contract compiled and ready for deployment. The SCL compiler (sclc) turns human-readable contracts into deterministic bytecode plus an ABI that nodes and tooling understand. We'll walk through installing the compiler, writing a minimal contract, and producing the artifacts every validator can verify.

Updated 08 Nov 20261 min read

#Install the compiler

You'll need a stable Rust toolchain with Cargo installed. Clone the compiler repository and build it:

bash
git clone https://github.com/Dark-Fusion-Protocol/scl-compiler
cd scl-compiler
cargo build --release

The compiled binary will be in:

text
target/release/sclc
info:

You can also download prebuilt binaries from the GitHub releases page (opens in a new tab).

#Write a minimal contract

Save this as hello.scl:

scl
contract Hello {
    greeting: Str;

    fn init(who: Str) {
        greeting = who;
    }

    fn greet() {
        PRINT("hello:", greeting);
        return 1;
    }
}

#Compile it

bash
sclc compile hello.scl --output hello.bin --abi hello.abi.json --metadata hello.meta.json

Useful variations:

bash
# Everything as one JSON blob (bytecode hex + ABI + metadata), the format
# the deploy API consumes
sclc compile hello.scl --json

# ABI only, no bytecode
sclc compile hello.scl --abi-only --abi - --abi-pretty

# Read from stdin, hex bytecode to stdout
cat hello.scl | sclc compile --stdout --hex

The compiler produces three artifacts:

  • Bytecode (.bin): the deterministic program the VM executes.
  • ABI (JSON): your contract's functions and events, in a schema compatible with standard tooling.
  • Metadata (JSON): constants and function offsets the node needs to execute calls.
success:

Compilation is fully deterministic: the same source always produces byte-identical output. That's what lets every validator verify your contract independently.

#Next steps

You now have the tools to compile contracts! Try out an example contract or continue in Contract development to learn the language basics, available built-ins, and how to deploy and interact with your contract. For a more in depth approach, continue on to the next section to learn more about the core concepts of SCL.

Was this page helpful?