solidity

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Skill based on Solidity (ethereum/solidity) docs, generated at 2026-02-09.
Solidity is a statically typed, object-oriented language for EVM smart contracts. This skill covers source layout, types, contract structure, control flow, security patterns, compiler usage, and ABI/internals.
基于Solidity(ethereum/solidity)文档生成的Skill,生成时间:2026-02-09。
Solidity是一种用于EVM智能合约的静态类型、面向对象编程语言。本Skill涵盖了源码结构、类型、合约结构、控制流、安全模式、编译器使用以及ABI/内部机制等内容。

Core References

核心参考

TopicDescriptionReference
Source LayoutSPDX, pragma, import, commentscore-layout
Contract StructureState, functions, modifiers, events, errors, structs, enumscore-structure
TypesValue/reference/mapping types, operators, conversionscore-types
Control Structuresif/loop, internal/external calls, revert, try/catchcore-control
Units and GlobalsEther/time units, block/msg/tx, ABI/hash helperscore-units-globals
主题描述参考
源码结构SPDX声明、pragma指令、导入语句、注释core-layout
合约结构状态变量、函数、修饰器、事件、错误、结构体、枚举core-structure
类型值类型/引用类型/映射类型、运算符、类型转换core-types
控制结构if/循环、内部/外部调用、revert、try/catchcore-control
单位与全局变量以太币/时间单位、block/msg/tx变量、ABI/哈希工具core-units-globals

Features

功能特性

Contracts

合约

TopicDescriptionReference
ContractsCreation, visibility, modifiers, functions, events, errors, inheritance, interfaces, libraries, using-forfeatures-contracts
Inline AssemblyYul in Solidity, access to variables, safetyfeatures-assembly
YulIntermediate language, EVM opcodes, objectsfeatures-yul
NatSpecTags, userdoc/devdoc output, @inheritdoc, @customfeatures-natspec
EventsIndexed, anonymous, topics, selector, emitfeatures-events
Custom Errorsrevert/require, selector, try/catch, ABIfeatures-errors
LibrariesDELEGATECALL, internal vs external, linkingfeatures-libraries
Inheritancevirtual/override, super, C3, base constructorsfeatures-inheritance
InterfacesRestrictions, enum/struct, ABI alignmentfeatures-interfaces
Transient StorageEIP-1153, transaction-scoped, reentrancy locksfeatures-transient-storage
Visibility and Gettersexternal/public/internal/private, getter generationfeatures-visibility-getters
主题描述参考
合约创建、可见性、修饰器、函数、事件、错误、继承、接口、库、using-forfeatures-contracts
内联汇编Solidity中的Yul、变量访问、安全性features-assembly
Yul中间语言、EVM操作码、对象features-yul
NatSpec标签、userdoc/devdoc输出、@inheritdoc、@customfeatures-natspec
事件索引、匿名、主题、选择器、emitfeatures-events
自定义错误revert/require、选择器、try/catch、ABIfeatures-errors
DELEGATECALL、内部与外部、链接features-libraries
继承virtual/override、super、C3线性化、基类构造函数features-inheritance
接口限制、枚举/结构体、ABI对齐features-interfaces
临时存储EIP-1153、事务作用域、重入锁features-transient-storage
可见性与Getterexternal/public/internal/private、自动生成Getterfeatures-visibility-getters

Best Practices

最佳实践

TopicDescriptionReference
SecurityReentrancy, gas, visibility, randomness, front-runningbest-practices-security
Common PatternsWithdrawal, access control, checks-effects-interactions, proxiesbest-practices-patterns
Style and LayoutFile/contract order, modifier order, namingbest-practices-style
主题描述参考
安全重入攻击、Gas优化、可见性、随机性、抢先交易best-practices-security
常见模式提取模式、访问控制、检查-效果-交互模式、代理best-practices-patterns
风格与结构文件/合约顺序、修饰器顺序、命名规范best-practices-style

Advanced

进阶内容

TopicDescriptionReference
Compilersolc CLI, Standard JSON, optimizer, libraries, path resolutionadvanced-compiler
InternalsStorage/memory/calldata layout, optimizer, source mappingsadvanced-internals
ABI and MetadataABI spec, contract metadata, NatSpecadvanced-abi-metadata
SMTCheckerFormal verification, engines, targets, optionsadvanced-smtchecker
Path ResolutionVFS, base/include paths, remapping, allowed pathsadvanced-path-resolution
Compilation OutputBytecode, --asm, optimized vs non-optimizedadvanced-compilation-output
主题描述参考
编译器solc CLI、标准JSON、优化器、库、路径解析advanced-compiler
内部机制存储/内存/调用数据结构、优化器、源码映射advanced-internals
ABI与元数据ABI规范、合约元数据、NatSpecadvanced-abi-metadata
SMTChecker形式化验证、引擎、目标、选项advanced-smtchecker
路径解析VFS、基础/包含路径、重映射、允许路径advanced-path-resolution
编译输出字节码、--asm、优化与非优化版本advanced-compilation-output