- Change
anchor-lang = "0.32.1"→anchor-lang = "1.0.0-rc.5" - Change
anchor-lang = { version = "0.32.1", ... }→anchor-lang = { version = "1.0.0-rc.5", ... } - Same for
anchor-splif present — change to1.0.0-rc.5 - Add comment:
# Anchor 1.0.0-rc.5 — pin to RC until stable release - REMOVE
interface-instructionsfeature if present (removed in Anchor 1.0). This affects transfer-hook projects. - Keep all other features as-is (
idl-build,init-if-needed,cpi, etc.)
- Remove
[registry]section if present (no longer used in Anchor 1.0) - Keep everything else
- Replace
"@coral-xyz/anchor": "..."with"@anchor-lang/core": "1.0.0-rc.5" - Bump
"typescript"to"^5.3.3"if it's on 4.x (required for @solana/web3.js peer dep) - Keep everything else
- Replace
import ... from "@coral-xyz/anchor"→import ... from "@anchor-lang/core" - Replace
import ... from '@coral-xyz/anchor'→import ... from '@anchor-lang/core' - Replace
require("@coral-xyz/anchor")→require("@anchor-lang/core")if any
- Usually NO changes needed
- If
AccountInfois used in an Accounts struct, replace withUncheckedAccount - If duplicate mutable accounts exist, add
#[account(dup)]constraint
- Run
cargo build-sbfin the anchor project directory to verify Rust builds - Run
pnpm installto verify deps install - Do NOT run tests (no validator available)
For projects that had features = ["interface-instructions"]:
- Remove that feature from Cargo.toml
- The
#[interface]attribute is removed — check if the program source uses it - If it does, this needs manual intervention to refactor