contract-patterns

Provide Solidity design patterns for secure smart contract development.

2|1|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/MolcajeteAI/plugin --skill contract-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contract-patterns
Source: https://github.com/MolcajeteAI/plugin/tree/main/deprecated/tech-stacks/solidity/skills/contract-patterns
Command: npx skills add https://github.com/MolcajeteAI/plugin --skill contract-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides battle-tested patterns and examples for common smart contract functionality, helping developers build secure and efficient decentralized applications.

Core Features & Use Cases

  • Access Control: Implement Ownable, AccessControl, Multisig, and Timelock patterns.
  • Upgradeability: Utilize Transparent Proxy, UUPS, Beacon Proxy, and Diamond patterns.
  • Security: Integrate Pausable, Reentrancy Guard, and standard token patterns (ERC20, ERC721, ERC1155).
  • Use Case: When developing a new ERC20 token, use this Skill to quickly implement secure minting, burning, and transfer functionalities with appropriate access controls and pause mechanisms.

Quick Start

Use the contract-patterns skill to generate an example of an ERC20 token with Ownable and Pausable functionality.

Frequently Asked Questions about contract-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure access control in Solidity smart contracts?

Secure access control in Solidity smart contracts is implemented using Ownable, AccessControl, Multisig, and Timelock patterns. These designs restrict function execution to authorized addresses and enforce administrative delays.

What is the best way to make a Solidity contract upgradeable?

The best way to make a Solidity contract upgradeable is by utilizing Transparent Proxy, UUPS, Beacon Proxy, or Diamond patterns. These architectures separate logic from data storage to enable post-deployment code updates.

How does a reentrancy guard protect ERC20 token contracts?

A reentrancy guard protects ERC20 token contracts by preventing external calls from hijacking execution flow during state changes. It applies a lock mechanism that blocks recursive function entry.

Can I use OpenZeppelin Contracts for ERC721 and ERC1155 token standards?

Yes, you can use OpenZeppelin Contracts for ERC721 and ERC1155 token standards. The library provides audited implementations for minting, burning, and transferring non-fungible and multi-token assets securely.

When do I need a pausable function in smart contract development?

You need a pausable function in smart contract development during emergency situations or vulnerabilities. It allows contract owners to freeze token transfers and critical state modifications temporarily.