How it works
From Solidity source to a Solana program.
SolScript is a real compiler, not a wrapper. Here is exactly what happens between your .sol file and a deployed Solana program.
How it works
From Solidity source to a Solana program.
SolScript parses your contract, type-checks it, and generates either readable Anchor/Rust or BPF bytecode — ready to deploy to devnet, testnet or mainnet.
The pipeline, stage by stage
Parse
SolScript parses your Solidity-style contract into an abstract syntax tree, understanding contracts, state variables, functions, modifiers, events and errors.
Type check
Semantic analysis validates types, state access and control flow — catching mistakes before any code is generated. Run it alone with solscript check.
Map to Solana
The key transformation: Solidity mappings become Program Derived Addresses. SolScript derives the correct seeds and bumps so account lookups are correct and deterministic.
Generate code
SolScript emits standard Rust/Anchor source — or, in BPF mode, compiles directly to Solana bytecode via LLVM 18.
Deploy
The generated program deploys to Solana devnet, testnet or mainnet with standard Solana tooling, or straight from the browser playground via Phantom or Solflare.
The key transformation: mappings → PDAs
Solana has no mapping type. SolScript turns each Solidity mapping into PDA-backed accounts, using the key as a seed and deriving the bump automatically — the single hardest part of porting Solidity, done for you.
// Solidity — a mapping of balances
mapping(address => uint256) public balanceOf; // SolScript output (conceptual): PDA-backed account per key
// seeds = ["balance", key], bump derived automatically
#[account]
pub struct Balance { pub value: u64 } Read the deep dive: Understanding PDA mappings →
Quickstart in five steps
- 1
Write a contract
Open the playground or create a .sol file. Use Solidity syntax: state variables, a mapping, a constructor and functions.
- 2
Type-check it
Run solscript check contract.sol (or watch live diagnostics in the playground / VS Code) to validate types and state access.
- 3
Compile to Anchor
Run solscript build contract.sol to generate readable Rust/Anchor source, with Solidity mappings converted to PDAs automatically.
- 4
Or compile to BPF
Run solscript build --bpf contract.sol to compile straight to Solana bytecode via LLVM 18 when you do not need the Rust source.
- 5
Deploy to devnet
Deploy the program with standard Solana tools, or one-click from the playground using a Phantom or Solflare wallet.
SolScript is built by Cryptuon.