contract-upgradeability

contract-upgradeability is a skill for Claude Code, Codex from PlamenTSV/plamen. It costs 27 tokens per session (1,874 once invoked), scanned A, original, MIT.

A Soroban security-audit guide for in-place contract upgrades. Soroban is Stellar’s smart-contract platform, and an upgrade can replace a contract’s WASM code without changing its address or stored data.

In plain words
What is it for?
Reviewing upgrade functions, authorization checks, privileged addresses, and upgrade-control patterns.
Why use it?
It helps verify that only the intended administrator or governance authority can change deployed contract code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Reviewing upgrade functions, authorization checks, privileged addresses, and upgrade-control patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plamentsv/plamen/contract-upgradeability
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PlamenTSV/plamen --skill contract-upgradeability
Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for contract-upgradeability

README.md
[![agentmods](https://agentmods.dev/badge/skills/plamentsv/plamen/contract-upgradeability/github.svg)](https://agentmods.dev/skills/plamentsv/plamen/contract-upgradeability)
Your own site
<a href="https://agentmods.dev/skills/plamentsv/plamen/contract-upgradeability"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/contract-upgradeability/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for contract-upgradeability

Your own site · 80×15
<a href="https://agentmods.dev/skills/plamentsv/plamen/contract-upgradeability"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/contract-upgradeability.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,874 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
SkillSpector: 2 findings, up to low

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • low Privilege Escalation · line 15
    Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.
    Fix: Request only the minimum permissions required. Document why each permission is needed. Remove broad permissions like '*' or 'all'.
  • low Privilege Escalation · line 145
    Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.
    Fix: Request only the minimum permissions required. Document why each permission is needed. Remove broad permissions like '*' or 'all'.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.01874
Opus 5 $0.00014 $0.00937
Sonnet 5 $0.00005 $0.00375
Haiku 4.5 $0.00003 $0.00187

Measured 7d ago against content hash 36eae61bebfc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

contract-upgradeability scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/skills/soroban/contract-upgradeability/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CONTRACT_UPGRADEABILITY Skill (Soroban)

Trigger Pattern: update_current_contract_wasm detected in codebase Inject Into: Breadth agents, depth-state-trace Finding prefix: [CU-N] Rules referenced: R6, R10, R12, R13

Soroban provides env.deployer().update_current_contract_wasm(new_wasm_hash) for in-place contract upgrades. This is more powerful than EVM proxy patterns — it directly replaces the executing contract's WASM bytecode without changing the contract address or storage. Unrestricted upgrade capability is an absolute control vector; the upgrade gate must be airtight.

1. Upgrade Access Control

Locate every call to update_current_contract_wasm and verify the auth gate:

Location Auth Check Present? Auth Address Auth Type Sufficient?
{file:line} YES/NO {admin / multisig / NONE} require_auth / require_auth_for_args / NONE YES/NO

Minimum requirement: The upgrade function MUST call require_auth() or require_auth_for_args() on a privileged address before calling update_current_contract_wasm.

Patterns to flag as insufficient:

  • No auth check at all (anyone can upgrade)
  • Auth check on a non-admin address (e.g., any token holder)
  • Auth check after update_current_contract_wasm is called (too late — code already replaced)
  • The privileged address is stored in Temporary storage (can be deleted/expired, unlocking upgrade for anyone)

Also check:

  • Is the admin address itself protected from replacement without auth? (see Section 3)
  • Can the upgrade function be called during initialization before admin is set? (init race)

2. Migration Safety

An upgrade replaces WASM but preserves ALL storage. If the new WASM has a different storage layout or new required keys, the upgrade function must handle migration:

Concern Addressed? Evidence Risk if Not Addressed
New storage keys initialized after upgrade YES/NO {fn:line or NONE} Panics on first access of uninitialized key
Removed storage keys cleaned up YES/NO {fn:line or NONE} Bloat only (low risk unless size-bounded)
Struct fields added/removed (ABI break) YES/NO {fn:line or NONE} Deserialization panic on old data
Version discriminator stored YES/NO {fn:line or NONE} Cannot detect state of migration

Read the full file on GitHub · 150 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 150 lines · 27 tokens per session scan A 36eae61bebfc

Subscribe to this mod's changes

contract-upgradeability is a skill published in the GitHub repository PlamenTSV/plamen (295 stars, last pushed 3d ago), licensed MIT. It adds 27 tokens to every session and 1,874 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.