Complete AI Training
Sign inGet my AI kit

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

AI agent for blockchain developers

Contract Upgrade Migration Agent

A contract upgrade proven safe against live storage and integrations

Contract Upgrade Migration Agent: what goes in, what the agent does and what you get

What it does

Upgrading an upgradeable contract is risky: if the new version's storage layout does not match the old one, stored data such as balances is read wrongly. Before an upgrade this agent compares the old and new storage layouts and flags any incompatible change, such as a reordered, removed or resized variable. It checks that the new version keeps the functions that integrations rely on. Then it runs the test suite against a fork of the live state to confirm existing data still reads correctly after the upgrade. Where a change would break storage or an interface, it describes the problem and a safe pattern, such as appending new variables only, then retests the reworked version. You approve the upgrade on the live network. Edge case: a type change that alters storage size is flagged, because it shifts every later slot.

How it works

Follow the arrows from top to bottom. The orange dashed arrow is the loop: when a check fails, the agent goes back and tries again.

Start and resultWhat it doesA check on its own workWaits for your OKGoes back and retries
Yes, continueYes, continueApprovedNoNo 1 STARTS WHEN Upgrade proposed 2 USES A TOOL Compare old and new storage layouts 3 CHECKS THE RESULT Is the new layout compatible with the old one? If not: describe the incompatible change and theappend-only pattern, then wait for a revised version.Back to step 2. 4 DOES Check retained functions against integration needs 5 USES A TOOL Fork the live state and apply the upgrade 6 USES A TOOL Run the test suite and read back existing data 7 CHECKS THE RESULT Does existing data read correctly and dointegrations still work? If not: describe the break and a safe pattern, thenrework and retest. Back to step 5. 8 YOU APPROVE Developer approves the upgrade on the live network 9 RESULT Upgrade verified with a report
Read the steps as a list
  1. Upgrade proposed
  2. Compare old and new storage layouts
  3. Is the new layout compatible with the old one?If not: describe the incompatible change and the append-only pattern, then wait for a revised version. Back to step 2.
  4. Check retained functions against integration needs
  5. Fork the live state and apply the upgrade
  6. Run the test suite and read back existing data
  7. Does existing data read correctly and do integrations still work?If not: describe the break and a safe pattern, then rework and retest. Back to step 5.
  8. Developer approves the upgrade on the live networkThe agent waits here for your OK.
  9. Upgrade verified with a report

How it decides

It blocks an upgrade that changes storage layout incompatibly or removes a relied-upon function, confirmed against a fork of live state.

  • Block incompatible storage layout changes
  • Require relied-upon functions to remain
  • Confirm against a fork of live state

Make it yours

Every agent is a starting point. You choose these settings for your own situation.

  • Integration interfaces to protect
  • State fork source
  • Tests to run
  • Upgrade pattern rules

What keeps you in control

It always asks you first

  • Upgrading the contract on the live network

Hard limits

  • Never upgrades the live contract without approval
  • Tests against real state before approval

It stops when

  • Done: upgrade verified safe
  • Stop: the live state fork is unavailable

Set it up

We guide you through the set-up, step by step

Members get the full set-up guide for this agent. No technical skills needed: you copy, paste and upload.

10 minto set it up in your AI
5 AIsChatGPT, Claude, Copilot, Gemini, Grok
  • One set of instructions to paste into your AI, with the clicks for ChatGPT, Claude, Microsoft 365 Copilot, Gemini and Grok
  • The agent then walks you through connecting your own data, one source at a time
  • A downloadable copy with the flow chart, the rules and the full guide
Get access to this agent

An example run

What happensBefore a September upgrade of a lending contract at a startup called Brightvale Finance, the new version inserted a variable mid-storage. The fork test showed corrupted user balances, so the check failed. The agent recommended appending the variable at the end instead. The reworked version read all 3,200 existing balances correctly, and integrations kept working. The lead developer approved the live upgrade.

More agents for blockchain developers