Getting Started with SolScript in 5 Minutes
Write and compile your first Solana smart contract in Solidity syntax using the SolScript browser playground. No installation required.
SolScript lets you write Solana smart contracts using Solidity syntax. If you know Solidity from Ethereum, you can start building on Solana immediately — no Rust required.
What You’ll Build
A simple counter contract that anyone can increment, but only the owner can reset. This covers state variables, events, custom errors, modifiers, and constructors.
Step 1: Open the Playground
Navigate to the SolScript Playground. The browser-based IDE includes a WASM-compiled SolScript compiler, so everything runs client-side with no setup.
Step 2: Write the Contract
contract Counter {
uint256 public count;
address public owner;
event Incremented(address indexed by, uint256 newValue);
error Unauthorized();
modifier onlyOwner() {
if (msg.sender != owner) revert Unauthorized();
_;
}
constructor() {
owner = msg.sender;
count = 0;
}
function increment() public {
count += 1;
emit Incremented(msg.sender, count);
}
function reset() public onlyOwner {
count = 0;
}
}
This is standard Solidity. The key difference is what happens when you compile: SolScript generates a Solana program instead of EVM bytecode.
Step 3: Compile
Click the Compile button in the playground. SolScript will:
- Parse the contract
- Validate types and access patterns
- Convert
mappingtypes to PDA (Program Derived Address) lookups - Generate Anchor/Rust code
You’ll see the generated Rust code in the output panel. It’s a standard Anchor program that you can inspect, modify, or audit.
Step 4: Deploy (Optional)
Connect a Solana wallet (Phantom or Solflare) and select a network (devnet recommended for testing). Click Deploy to send the compiled program to Solana.
What Just Happened?
You wrote a smart contract in Solidity syntax and deployed it to Solana. Behind the scenes, SolScript:
- Converted your
address public ownerstate variable into a Solana account field - Turned the
constructor()into an Anchorinitializeinstruction - Mapped
msg.senderto the transaction signer - Generated all the Anchor account validation boilerplate
Next Steps
- Browse the examples for token contracts, AMMs, and more
- Read the SolScript vs Anchor comparison to understand the trade-offs
- Try the token contract tutorial