Skip to content

Commit d2cca1f

Browse files
0xrinegadeclaude
andcommitted
feat(ovsm): Add Round 4 signed CPI variants for PDA authority
Add signed CPI variants for PDA-based account operations: - spl-close-account-signed: Close token accounts with PDA authority - system-allocate-signed: Allocate account space with PDA signer - system-assign-signed: Assign ownership with PDA signer All variants follow the same signer seeds format as spl-token-transfer-signed: signers: [[[seed1-ptr seed1-len] [seed2-ptr seed2-len] ...]] Updated CLAUDE.md with Round 4 macro documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 702f238 commit d2cca1f

File tree

2 files changed

+636
-38
lines changed

2 files changed

+636
-38
lines changed

crates/ovsm/CLAUDE.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ src/
4545

4646
### Compiler (`compiler/ir.rs`) - **MOST IMPORTANT FILE**
4747
- Generates sBPF bytecode from OVSM source
48-
- 4800+ lines containing ALL macro implementations
48+
- 6100+ lines containing ALL macro implementations
4949
- Key sections:
5050
- Struct operations (lines ~1100-1600)
51-
- Account access (lines ~3500-3900)
5251
- CPI helpers (lines ~1900-3000)
53-
- Event emission (lines ~4000-4100)
54-
- Sysvar access (lines ~4100-4230)
55-
- PDA caching (lines ~4320-4500)
52+
- SPL Token CPIs (lines ~3000-3400)
53+
- Round 4 macros (lines ~3380-4300)
54+
- Anchor error handling (lines ~4290-4400)
55+
- PDA operations (lines ~4400-4600)
56+
- Event emission (lines ~4800-4900)
57+
- Sysvar access (lines ~4900-5100)
58+
- PDA caching (lines ~5100-5300)
5659

5760
## Building & Testing
5861

@@ -121,6 +124,17 @@ if name == "my-macro" && args.len() == 2 {
121124
- `spl-token-transfer`, `spl-token-transfer-signed`
122125
- `spl-token-mint-to`, `spl-token-burn`
123126

127+
### Round 4 CPI & Error Handling (NEW)
128+
- `spl-close-account` - Close token account, reclaim lamports
129+
- `spl-close-account-signed` - Close with PDA authority
130+
- `system-allocate` - Allocate space in account (System Program)
131+
- `system-allocate-signed` - Allocate with PDA signer
132+
- `system-assign` - Assign account ownership to program
133+
- `system-assign-signed` - Assign with PDA signer
134+
- `anchor-error` - Return Anchor-compatible error (6000 + code)
135+
- `require` - Assert condition or abort with Anchor error
136+
- `msg` - Log message (Anchor-style, uses `sol_log_`)
137+
124138
### PDA Operations
125139
- `derive-pda`, `create-pda`, `get-ata`
126140
- `pda-cache-init`, `pda-cache-store`, `pda-cache-lookup`

0 commit comments

Comments
 (0)