solidity
1
总安装量
1
周安装量
#42490
全站排名
安装命令
npx skills add https://github.com/g1joshi/agent-skills --skill solidity
Agent 安装分布
mcpjam
1
claude-code
1
replit
1
junie
1
zencoder
1
Skill 文档
Solidity
Solidity is the primary language for the Ethereum Virtual Machine (EVM). v0.8.28 (2025) focuses on transient storage (tstore) and gas optimization via IR.
When to Use
- Ethereum/L2s: Developing for Optimism, Arbitrum, Base.
- DeFi: Writing logic for tokens, AMMs, and lending.
- NFTs: ERC-721 and ERC-1155 contracts.
Core Concepts
Gas
Every operation costs ETH. Optimization is critical.
Modifiers
Reusable checks. modifier onlyOwner { ... }.
Events
Logging on the blockchain. emit Transfer(from, to, value).
Best Practices (2025)
Do:
- Use Foundry: The 2025 standard for testing (Solidity-based tests).
- Use Custom Errors:
error InsufficientBalance();is cheaper than string requires. - Use OpenZeppelin: Don’t roll your own crypto/auth logic.
Don’t:
- Don’t ignore reentrancy: Use
ReentrancyGuardor Checks-Effects-Interactions pattern.