Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add zizhilong/evm-developer-skill
Or install specific skill: npx add-skill https://github.com/zizhilong/evm-developer-skill
# Description
Comprehensive Solidity smart contract development and deployment workflow for EVM-compatible chains. Handles project creation, contract development, compilation, testing, deployment, and verification with structured project management.
# SKILL.md
name: evm-developer
description: Comprehensive Solidity smart contract development and deployment workflow for EVM-compatible chains. Handles project creation, contract development, compilation, testing, deployment, and verification with structured project management.
EVM Developer Skill
This skill provides a complete workflow for developing, testing, and deploying Solidity smart contracts on EVM-compatible blockchains with proper project structure and documentation.
Core Capabilities
- Smart Contract Development: Write Solidity contracts with best practices and security patterns
- Project Management: Structured project organization with templates and documentation
- Deployment Pipeline: Automated deployment to multiple networks with complete tracking
- Contract Verification: Automatic verification on block explorers
- ABI Management: Automatic extraction and organization of contract ABIs
- Security Best Practices: Built-in security patterns and checks
Development Workflow
1. Initial Assessment
When a user requests smart contract development:
- Check for Existing Project: Ask if this is a new project or modification to existing one
- If New Project: Initiate requirements gathering
- If Existing: List available projects in
projects/directory and ask which to work on
2. Requirements Gathering (New Projects Only)
Ask the following questions systematically:
Basic Information
- Project Name: What should the project be called? (will be used as directory name)
- Project Description: Brief description of the project's purpose
Contract Type
- ERC20 Token
- ERC721 NFT
- ERC1155 Multi-Token
- DeFi Protocol (DEX/Staking/Lending)
- DAO Governance
- Custom Contract Logic
Feature Requirements
- Core Functions: What are the main functions needed?
- Access Control:
- [ ] Ownable (single owner)
- [ ] AccessControl (role-based)
- [ ] No special permissions
- Security Features:
- [ ] Pausable (emergency stop)
- [ ] ReentrancyGuard (prevent reentrancy attacks)
- [ ] Upgradeable (proxy pattern)
- Additional Features: Any other specific requirements
Technical Parameters
- Solidity Version: Default to
^0.8.20unless specified - Use OpenZeppelin: Yes (recommended) / No
- Gas Optimization Level: Low / Medium / High
Deployment Target
- Target Blockchain: Ethereum / BSC / Polygon / Arbitrum / Optimism / Other
- Network Type: Mainnet / Testnet / Local
- Verification Required: Yes / No
3. Project Initialization
For new projects, execute the following steps:
-
Create Project Directory Structure:
projects/<project-name>/ ├── README.md ├── requirements.md ├── contracts/ ├── scripts/ │ └── deploy.js ├── test/ ├── abi/ ├── deployments/ ├── hardhat.config.js ├── package.json └── .env.example -
Initialize Hardhat Project:
bash cd projects/<project-name> npm init -y npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox npm install @openzeppelin/contracts dotenv -
Generate Requirements Document: Create
requirements.mdfrom gathered information -
Update Project Index: Add entry to
projects/README.md
4. Contract Development
-
Write Solidity Code: Create contracts following conventions in
references/conventions.md -
Apply Security Patterns:
- Use Checks-Effects-Interactions pattern
- Add ReentrancyGuard for external calls
- Include proper access control
- Add events for all state changes
-
Use NatSpec documentation
-
Compile Contract:
bash npx hardhat compile -
Extract ABI: After successful compilation, copy ABI from
artifacts/contracts/<ContractName>.sol/<ContractName>.jsontoabi/<ContractName>.json
5. Testing
- Generate Test File: Create basic test in
test/<ContractName>.test.js - Run Tests:
bash npx hardhat test - Ensure Coverage: All core functions should be tested
6. Deployment
-
Configure Network: Update
hardhat.config.jswith target network settings -
Set Environment Variables: Guide user to create
.envfile:
PRIVATE_KEY=<deployer_private_key> SEPOLIA_RPC_URL=<rpc_url> ETHERSCAN_API_KEY=<api_key> -
Execute Deployment:
bash npx hardhat run scripts/deploy.js --network <network_name> -
Record Deployment Information: Save to
deployments/<network>.jsonwith format:
json { "projectName": "ProjectName", "contractName": "ContractName", "solFileName": "ContractName.sol", "deployments": [{ "network": "sepolia", "chainId": 11155111, "contractAddress": "0x...", "deployer": "0x...", "deploymentTx": "0x...", "blockNumber": 123456, "timestamp": "2026-02-02T03:00:00.000Z", "gasUsed": "500000", "verified": false, "constructorArgs": [], "notes": "Initial deployment" }] }
7. Contract Verification
-
Verify on Block Explorer:
bash npx hardhat verify --network <network> <contract_address> <constructor_args> -
Update Deployment Record: Set
verified: trueand addverificationUrl -
Update Project README: Add deployment information and contract addresses
8. Project Documentation
After deployment, ensure the following are updated:
- Project README: Include contract addresses, network info, and usage instructions
- Project Index (
projects/README.md): Update with deployment status - Deployment History: Maintain complete deployment records
Development Standards
Naming Conventions
- Contracts: PascalCase (e.g.,
MyToken,NFTMarketplace) - Functions: camelCase (e.g.,
transferFrom,mintToken) - Constants: UPPER_SNAKE_CASE (e.g.,
MAX_SUPPLY,MINTER_ROLE) - Private Variables: _leadingUnderscore (e.g.,
_balances,_owner) - Files: Match contract name (e.g.,
MyToken.sol)
File Organization
- One contract per file
- Interfaces in
contracts/interfaces/ - Libraries in
contracts/libraries/ - Abstract contracts in
contracts/abstract/
Code Documentation
- All public/external functions must have NatSpec comments
- Complex logic requires inline comments
- Contract-level documentation with license and description
Example:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @title MyToken
/// @notice ERC20 token with pausable functionality
/// @dev Extends OpenZeppelin's ERC20 and Pausable contracts
contract MyToken is ERC20, Pausable, Ownable {
/// @notice Mints new tokens to specified address
/// @dev Only owner can mint
/// @param to Address to receive tokens
/// @param amount Amount of tokens to mint
function mint(address to, uint256 amount) external onlyOwner {
_mint(to, amount);
}
}
Security Checklist
Before deployment, verify:
- [ ] No reentrancy vulnerabilities (use ReentrancyGuard)
- [ ] Proper access control (Ownable/AccessControl)
- [ ] Integer overflow protection (use Solidity 0.8+)
- [ ] External calls checked for failures
- [ ] Events emitted for state changes
- [ ] No use of
tx.originfor authentication - [ ] Randomness uses secure method (if applicable)
- [ ] Gas optimization considerations applied
- [ ] All functions have proper visibility
- [ ] Private keys never hardcoded
Gas Optimization Patterns
- Use
calldatainstead ofmemoryfor read-only function parameters - Pack storage variables efficiently
- Use events instead of storage for logs
- Batch operations when possible
- Use
uncheckedfor safe arithmetic (carefully) - Short-circuit boolean operations
Network Configuration
Common EVM networks:
Testnets
- Ethereum Sepolia: ChainID 11155111
- Polygon Mumbai: ChainID 80001
- BSC Testnet: ChainID 97
- Arbitrum Sepolia: ChainID 421614
- Optimism Sepolia: ChainID 11155420
Mainnets
- Ethereum: ChainID 1
- Polygon: ChainID 137
- BSC: ChainID 56
- Arbitrum One: ChainID 42161
- Optimism: ChainID 10
Error Handling
When compilation or deployment fails:
- Parse Error Messages: Extract relevant information
- Suggest Fixes: Based on common patterns
- Retry: After fixes are applied
- Log Issues: Document in project for reference
Automation Tools
This skill uses helper scripts in scripts/:
- create-project.js: Automates project creation
- deploy-helper.js: Streamlines deployment and record keeping
- verify-contract.js: Automates contract verification
Resources
- Deployment Guide:
references/deployment-guide.md - Security Best Practices:
references/security.md - Development Conventions:
references/conventions.md - Complete Workflow:
references/workflow.md
Best Practices
- Always test locally first: Use Hardhat Network before testnet deployment
- Test on testnet: Deploy to testnet before mainnet
- Security audit: For mainnet deployments, recommend professional audit
- Verify contracts: Always verify on block explorers for transparency
- Document everything: Maintain comprehensive documentation
- Version control: Track all changes and deployments
- Environment security: Never commit
.envfiles or private keys
Project Lifecycle
User Request → Requirements → Project Setup → Development →
Compilation → Testing → Testnet Deployment → Verification →
(Optional: Audit) → Mainnet Deployment → Documentation
Each step should be confirmed successful before proceeding to the next.
# README.md
EVM Developer Skill
Professional toolkit for Solidity smart contract development and deployment on EVM-compatible blockchains.
Overview
The EVM Developer skill provides a comprehensive, structured workflow for developing, testing, and deploying smart contracts with:
- Standardized Project Structure: Consistent organization across all projects
- Automated Workflows: Scripts for project creation, deployment, and verification
- Best Practices: Security patterns, coding conventions, and optimization techniques
- Complete Documentation: Guides, templates, and references
- Multi-Chain Support: Deploy to any EVM-compatible blockchain
Quick Start
Prerequisites
- Node.js (v16+)
- npm or yarn
- Code editor (VS Code recommended)
Create a New Project
node scripts/create-project.js <project-name> "<description>" <contract-type>
Development Workflow
- Write Contract: Add Solidity code to
contracts/ - Compile:
npx hardhat compile - Test:
npx hardhat test - Deploy:
npx hardhat run scripts/deploy.js --network <network> - Verify:
npx hardhat verify --network <network> <address>
Directory Structure
evm-developer/
├── SKILL.md # This file - skill documentation
├── README.md # Project overview
├── projects/ # All smart contract projects
│ └── README.md # Project index
├── templates/ # Project and contract templates
│ ├── contract-templates/ # Reusable contract templates
│ └── project-structure.json
├── references/ # Development guides
│ ├── deployment-guide.md
│ ├── security.md
│ ├── conventions.md
│ └── workflow.md
├── scripts/ # Automation scripts
│ ├── create-project.js
│ ├── deploy-helper.js
│ └── verify-contract.js
└── plans/ # Architecture documentation
Key Features
1. Project Management
- Automated project creation with standard structure
- Project indexing and tracking
- Deployment record keeping
- ABI extraction and management
2. Development Standards
- Solidity coding conventions
- Security best practices
- Gas optimization patterns
- Comprehensive documentation requirements
3. Deployment Pipeline
- Multi-network configuration
- Automated deployment scripts
- Deployment tracking and history
- Contract verification support
4. Security Focus
- Built-in security patterns
- Access control templates
- Reentrancy protection
- Emergency pause mechanisms
Resources
Documentation
- Workflow Guide - Complete development workflow
- Security Best Practices - Security patterns and checklists
- Coding Conventions - Code style and standards
- Deployment Guide - Deployment instructions
Templates
- ERC20 Token - Standard fungible token
- ERC721 NFT - Non-fungible token implementation
- Project Templates - Standard project structure
Automation Scripts
- create-project.js - Automated project creation
- deploy-helper.js - Deployment utilities
- verify-contract.js - Contract verification
Supported Networks
Testnets
- Ethereum Sepolia
- Polygon Mumbai
- BSC Testnet
- Arbitrum Sepolia
- Optimism Sepolia
Mainnets
- Ethereum Mainnet
- Polygon
- BNB Smart Chain
- Arbitrum One
- Optimism
- Avalanche C-Chain
Common Tasks
Creating a New Token
node scripts/create-project.js my-token "My ERC20 Token" ERC20
cd projects/my-token
# Edit contracts/MyToken.sol
npx hardhat compile
npx hardhat test
Deploying to Testnet
# Configure .env with PRIVATE_KEY and RPC_URL
npx hardhat run scripts/deploy.js --network sepolia
Verifying Contract
npx hardhat verify --network sepolia <CONTRACT_ADDRESS> <CONSTRUCTOR_ARGS>
Best Practices
- Always test locally first - Use Hardhat Network for initial testing
- Deploy to testnet - Verify functionality before mainnet
- Security audit - Review code and consider professional audit for high-value contracts
- Verify contracts - Ensure transparency by verifying on block explorers
- Document thoroughly - Maintain clear documentation for all contracts
- Version control - Use git to track all changes
- Environment security - Never commit private keys or
.envfiles
Development Principles
Security First
- Use OpenZeppelin contracts as base
- Follow Checks-Effects-Interactions pattern
- Implement access control and emergency stops
- Test extensively with edge cases
Code Quality
- Write clear, readable code
- Use NatSpec documentation
- Follow naming conventions
- Keep functions focused and modular
Gas Efficiency
- Optimize storage layout
- Use appropriate data locations (calldata, memory, storage)
- Batch operations where possible
- Profile gas usage in tests
Support & Resources
- OpenZeppelin Contracts: https://docs.openzeppelin.com/contracts
- Hardhat Documentation: https://hardhat.org/docs
- Solidity Documentation: https://docs.soliditylang.org
- Ethereum Development: https://ethereum.org/developers
Contributing
When adding new templates or improving workflows:
1. Follow existing conventions
2. Update relevant documentation
3. Test thoroughly
4. Update this README if needed
License
MIT License - See individual project licenses for specific contracts.
Version: 1.0.0
Last Updated: 2026-02-02
Maintained by: EVM Developer Skill Contributors
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.