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 --releaseThe compiled binary will be in:
target/release/sclcYou can also download prebuilt binaries from the GitHub releases page (opens in a new tab).
#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.jsonUseful 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 --hexThe 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.
#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.