Proxy patterns for upgradeable smart contracts. Use when implementing or reviewing upgradeable contracts.
/plugin marketplace add IvanTorresEdge/molcajete.ai/plugin install ivantorresedge-sol-tech-stacks-solidity@IvanTorresEdge/molcajete.aiThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Reference skill for proxy patterns in Solidity. Detailed proxy implementations are covered in the contract-patterns skill.
Use this skill when:
For detailed proxy implementations, see:
patterns/upgradeable-contracts.mdchecklists/upgrade-checklist.md| Pattern | Upgrade Location | Best For | Complexity |
|---|---|---|---|
| UUPS | Implementation | Most cases | Medium |
| Transparent | Proxy | Admin separation | Low |
| Beacon | Beacon contract | Multiple instances | High |
| Diamond | Facet contracts | Large contracts | Very High |
Recommended for most use cases
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
contract MyContract is UUPSUpgradeable, OwnableUpgradeable {
constructor() {
_disableInitializers();
}
function initialize() public initializer {
__Ownable_init(msg.sender);
__UUPSUpgradeable_init();
}
function _authorizeUpgrade(address) internal override onlyOwner {}
}
Pros:
Cons:
Detailed documentation: See contract-patterns/patterns/upgradeable-contracts.md
Use when admin/user separation is critical
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
// Deploy
TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
implementationAddress,
adminAddress,
initData
);
Pros:
Cons:
Detailed documentation: See contract-patterns/patterns/upgradeable-contracts.md
Use for multiple instances sharing implementation
import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
import "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
// Deploy beacon
UpgradeableBeacon beacon = new UpgradeableBeacon(implementationAddress);
// Deploy proxies
BeaconProxy proxy1 = new BeaconProxy(address(beacon), initData);
BeaconProxy proxy2 = new BeaconProxy(address(beacon), initData);
// Upgrade all
beacon.upgradeTo(newImplementation);
Pros:
Cons:
Detailed documentation: See contract-patterns/patterns/upgradeable-contracts.md
Use for contracts exceeding size limits
Complex pattern with multiple facets. See EIP-2535 for specification.
Critical for all proxy patterns:
// V1
contract V1 {
uint256 public value;
address public owner;
}
// V2 - ✅ Safe upgrade
contract V2 {
uint256 public value; // Same position
address public owner; // Same position
uint256 public newValue; // Added at end
}
// V2 - ❌ Unsafe upgrade
contract V2Bad {
address public owner; // ❌ Changed position
uint256 public value; // ❌ Changed position
}
Rules:
Choose UUPS if:
Choose Transparent if:
Choose Beacon if:
Choose Diamond if:
contract-patterns/patterns/upgradeable-contracts.mdsecurity-audit/checklists/upgrade-checklist.mdupgrade-safety/SKILL.mdcontract-patterns/examples/upgradeable-example.solNote: This is a reference skill. For detailed implementations and examples, see the contract-patterns skill.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.