Skip to main content

Contract Version Diffs

Compares source code between contract implementation versions.

Capabilities

  • Structured diffs of code changes
  • Works with proxy/implementation patterns
  • Compare last two or all historical versions

Example Queries

Parameters

The contract address is automatically determined from the current context. Make sure you’ve referenced a contract before asking for diffs.

Usage

Latest Upgrade

Full History

Uses compareAllVersions: true to show every upgrade.

Understanding the Output

Diff Format

Changes are shown in a structured format:

Change Summary

Why This Matters

Security Research

When a contract is upgraded, you want to know:
  • Were security fixes applied?
  • Were new features added that could introduce risk?
  • Were any functions removed or modified?

Protocol Analysis

Understanding how a protocol evolves:
  • What features were added over time?
  • How did the team respond to issues?
  • What’s the upgrade frequency?

Due Diligence

Before interacting with a protocol:
  • Was it recently upgraded?
  • What changed in the upgrade?
  • Does the new code look safe?

Real-World Example

USDC Contract Upgrade Analysis

You: “Analyze the changes in the last USDC upgrade” Claude might return:

Proxy Pattern Detection

The tool automatically handles different proxy patterns:

Tips

Start with metadata to understand the proxy structure.
Be specific: “Did the upgrade change how withdrawals work?”

Limitations

Requires verified implementations. All versions must have verified source code.
Proxy detection limitations. Some custom proxy patterns may not be automatically detected.

Next Steps

Contract Metadata

Get the full contract overview

Transaction Analysis

See how the contract is being used