x402agent/SolanaOS / skills/qedgen
qedgen
FlaggedFormally verify programs by writing Lean 4 proofs. Trigger this skill whenever the user wants to formally verify code, generate Lean 4 proofs, prove properties about algorithms or smart contracts, verify invariants, convert program logic into formal specifications, or anything involving Lean 4 and formal verification. Also trigger when the user mentions "qedgen", "lean proof", "formal proof", "verify my code", "prove correctness", "formal verification", or wants mathematical guarantees about their implementation.
lean_solana/test_lemmas.lean
View on GitHubimport QEDGen.Solana.Account
import QEDGen.Solana.State
import QEDGen.Solana.Cpi
import QEDGen.Solana.Authority
open QEDGen.Solana
-- Test 1: closes_is_closed works
example (before after : Lifecycle) (h : closes before after) :
after = Lifecycle.closed := by
exact closes_is_closed before after h
-- Test 2: closes_was_open works
example (before after : Lifecycle) (h : closes before after) :
before = Lifecycle.open := by
exact closes_was_open before after h
-- Test 3: findByAuthority is find? by authority
example (accs : List Account) (auth : Pubkey) :
findByAuthority accs auth = accs.find? (fun acc => acc.authority = auth) := by
rfl
-- Test 4: authorized_refl works
example (auth : Pubkey) : QEDGen.Solana.Authority.Authorized auth auth := by
exact QEDGen.Solana.Authority.authorized_refl auth
-- Test 5: targetsProgram with real TOKEN_PROGRAM_ID
example : targetsProgram
{ programId := TOKEN_PROGRAM_ID, accounts := [⟨1, true, false⟩], data := [DISC_TRANSFER] }
TOKEN_PROGRAM_ID := by
unfold targetsProgram
rfl
-- Test 6: accountAt on concrete list
example : accountAt
{ programId := TOKEN_PROGRAM_ID, accounts := [⟨42, false, true⟩, ⟨99, true, false⟩], data := [DISC_TRANSFER] }
1 99 true false := by
unfold accountAt
rfl
-- Test 7: hasDiscriminator with SPL Token transfer discriminator
example : hasDiscriminator
{ programId := TOKEN_PROGRAM_ID, accounts := [], data := [DISC_TRANSFER, 0, 0, 0, 100] }
[DISC_TRANSFER] := by
unfold hasDiscriminator
rfl
-- Test 8: hasDiscriminator with System Program 4-byte discriminator
example : hasDiscriminator
{ programId := SYSTEM_PROGRAM_ID, accounts := [], data := [2, 0, 0, 0, 100] }
DISC_SYS_TRANSFER := by
unfold hasDiscriminator
rfl
-- Test 9: hasNAccounts
example : hasNAccounts
{ programId := TOKEN_PROGRAM_ID, accounts := [⟨1, false, true⟩, ⟨2, false, true⟩, ⟨3, true, false⟩], data := [DISC_TRANSFER] }
3 := by
unfold hasNAccounts
rfl
-- Test 10: program IDs are distinct
example : TOKEN_PROGRAM_ID ≠ SYSTEM_PROGRAM_ID := by decide
example : TOKEN_PROGRAM_ID ≠ TOKEN_2022_PROGRAM_ID := by decide
example : TOKEN_PROGRAM_ID ≠ ASSOCIATED_TOKEN_PROGRAM_ID := by decide
-- Test 11: closed_cannot_close works
example (p_after : Lifecycle) : ¬ closes Lifecycle.closed p_after := by
exact closed_cannot_close p_after
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |