📜 Solana Smart Contracts
Solana Architecture
Concept
Solana's programming model is different from EVM chains. Everything is an Account — programs, wallets, and data storage. Programs are stateless; state lives in separate accounts.
Key concepts:
• Programs — executable accounts (your smart contract)
• Accounts — data storage, hold SOL (lamports)
• Instructions — the interface to your program
• Transactions — bundle of instructions executed atomically
example.rs
// A minimal Solana program using Anchor
use anchor_lang::prelude::*;
declare_id!("Your_Program_ID_Here");
#[program]
pub mod my_first_program {
use super::*;
pub fn say_hello(ctx: Context<SayHello>) -> Result<()> {
msg!("Hello from Solana! 🦀");
Ok(())
}
}
#[derive(Accounts)]
pub struct SayHello {}Quick Check
In Solana, where does a program store its state?
1 / 3