Compile Vyper smart contracts to Solana SVM programs using LLVM IR.
VyperSVM extends the Vyper programming language to target Solana's Virtual Machine (SVM) instead of Ethereum's EVM. It maintains Vyper's Python-like syntax while generating LLVM IR that compiles to Solana-compatible sBPF bytecode.
- Frontend: Vyper syntax analysis (unchanged)
- Intermediate: VENOM IR (Vyper's internal representation)
- Backend: LLVM IR generation for Solana
- Output: sBPF program deployable on Solana
# Clone the repository
git clone <repository-url>
cd vysvm
# Install dependencies
pip install llvmlite
# Install LLVM tools
brew install llvm
# Install sbpf-linker
cargo install sbpf-linker# Compile to LLVM IR
PYTHONPATH=vysvm python -m vyper.cli.vyper_compile contract.vy --experimental-codegen -f llvm > contract.ll
# Assemble to bitcode
llvm-as contract.ll -o contract.bc
# Link to sBPF
sbpf-linker contract.bc -o contract.sochmod +x build_svm.sh
./build_svm.sh# test.vy
event LogMessage:
message: String[32]
@external
def entrypoint() -> uint256:
log LogMessage(message="Hello from Vyper on SVM!")
return 0- ✅ Basic arithmetic operations (add, sub, mul)
- ✅ Solana entrypoint generation
- ✅ Syscall integration (sol_log_)
- ✅ LLVM IR output
- ✅ Control flow (jmp, jnz)
- ✅ Function calls
- 🔄 Storage operations
- No gas costs
- Different storage model (accounts vs slots)
- Solana syscalls instead of opcodes
- sBPF instead of EVM bytecode
- Modify code in
vysvm/directory - Test with
build_svm.sh - Deploy to Solana testnet for validation
MIT