Skip to content

📚 Add support for importing OpenZeppelin utility libraries #5

@pxlvre

Description

@pxlvre

🎯 Goal

Extend OpenZeppelin integration beyond tokens to include utility libraries and components.

📋 Current Limitation

Currently only supports token contracts (ERC20, ERC721, ERC1155). Need support for:

  • Access control utilities
  • Security libraries
  • Math utilities
  • Proxy patterns
  • Governance components

🔧 Tasks

Core Library Updates

  • Extend ContractType enum with library types
  • Add LibraryType enum for different utility categories
  • Update template generation for libraries

New Library Types

  • Access Control: Ownable, AccessControl, Roles
  • Security: ReentrancyGuard, Pausable
  • Math: SafeMath, Math, SignedMath
  • Utils: Strings, Arrays, Address
  • Proxy: Initializable, UUPSUpgradeable
  • Governance: Governor, Votes, Timelock

CLI Integration

  • Add --oz-access-control flag
  • Add --oz-security flag
  • Add --oz-math flag
  • Add --oz-utils flag
  • Add --oz-proxy flag
  • Add --oz-governance flag

Wotan Updates

  • Library selection in interactive wizard
  • Category-based library browsing
  • Dependency management suggestions

Examples

gramr new contract MyContract --solidity --oz-access-control
gramr new contract SecureContract --solidity --oz-security --oz-access-control
gramr new library MathUtils --solidity --oz-math

✅ Definition of Done

  • All major OpenZeppelin library categories supported
  • CLI flags implemented and documented
  • Wotan wizard includes library selection
  • Documentation includes library examples

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestopenzeppelinOpenZeppelin templates and integrationstemplatesContract and code templates

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions