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.

Install the compiler

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

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

The compiled binary will be in:

target/release/sclc

You can also download prebuilt binaries from the GitHub releases page.

Write a minimal contract

Save this as hello.scl:

contract Hello {
    greeting: Str;

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

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

Compile it

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

Useful variations:

# 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.

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

Try it in your browser

Want a feel for the workflow before installing anything? This demo shell has sclc preloaded and hello.scl already on disk. The output is simulated, but the commands and artifacts mirror the real CLI.

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.