Solana
Browse all Solana articles.
6 min read
Reading Another Anchor Program's Account Data On Chain
In Solidity, reading another contract's storage requires calling a view function or the storage variable being public.
3 min read
Multicall in Solana: Batching Transactions and Transaction Size Limit
In Ethereum, we use the multicall pattern if we want to batch multiple transactions together atomically. If one fails, the rest fails.
4 min read
#[derive(Accounts)] in Anchor: different kinds of accounts
#[derive(Accounts)] in Solana Anchor is an attribute-like macro for structs that holds references to all the accounts the function will access during its…
4 min read
Reading an account balance in Anchor: address(account).balance in Solana
The UncheckedAccount type tells to Anchor to not check if the account being read is owned by the program.
6 min read
Tx.origin, msg.sender, and onlyOwner in Solana: identifying the caller
In Solidity, the msg.sender is a global variable that represents the address that called or initiated a function call on a smart contract.
6 min read
PDA (Program Derived Address) vs Keypair Account in Solana
A program derived address (PDA) is an account whose address is derived from the address of the program that created it and the seeds passed in to the…
7 min read
Init_if_needed in Anchor and the Reinitialization Attack
In previous tutorials, we've had to initialize an account in a separate transaction before we can write data to it.
7 min read
The unusual syntax of Rust
Readers coming from a Solidity or Javascript background may find Rust's usage and syntax of &, mut, <_>, unwrap(), and ? to be weird (or even ugly).
7 min read
Modifying accounts using different signers
In our Solana tutorials thus far, we've only had one account initialize and write to the account. In practice, this is very restrictive.
4 min read
Transferring SOL and building a payment splitter: "msg.value" in Solana
This tutorial will introduce the mechanism by which Solana Anchor programs can transfer SOL as part of the transaction.
7 min read
Understanding Account Ownership in Solana: Transferring SOL out of a PDA
The owner of an account in Solana is able to reduce the SOL balance, write data to the account, and change the owner.
4 min read
Solana logs, "events," and transaction history
Solana programs can emit events similar to how Ethereum emits events, though there are some differences we will discuss.