Smart Contract Development in VS Code (Solidity)The Solidity language powers Ethereum smart contracts. This Visual Studio Code extension provides helpful features such as:
To use as a standalone language server:
Custom Compiler VersionsIf you need a compiler version other than the built-in one, use the versions hosted in the solc-bin repo. Four ways to customize:
Adjust via user or workspace settings. Remote compilerFetches directly from solc-bin:
Local versionManually download
NPM installYou can also install the compiler as a local package:
Set settings accordingly to use it. File-specific compilerIt's possible to assign a different compiler for individual contracts. ERC Snippets & InterfacesTo save time, ERCs and commonly used interfaces are built into the extension. Just type You can also use Optimizing CompilerFor usage-optimized output:
Workspace & Remapping SupportHandles multiple contracts in a mono-repo setup using files like Default dependencies handled from:
You can specify deeper paths if needed. RemappingsRemappings help manage dependency paths:
Auto-complete, Compile Errors, NavigationGet in-line feedback:
Code Fixes & Quick ActionsGet suggestions like switching compiler or formatting addresses on the fly. Fetch Verified Contracts from EtherscanRight-click and input the contract address + network to pull the source + ABI. Linting OptionsTwo options: Solhint (default):
Solium/Ethlint:
Code FormattingSupports Prettier with Solidity plugin. Use
Enable on save:
Alternatively, use Code Generation via NethereumThe extension can autogenerate API clients based on compiled contract JSON. To configure automatic generation:
Language Options:
Use right-click or command palette to trigger code generation manually or automatically on build. Multi-Settings SupportDefine multiple generation scenarios via
You can include multiple configurations for Unity clients, Mud tables, etc. Getting InvolvedTo suggest improvements, raise issues or contribute, join us on Discord: https://discord.gg/u3Ej2BReNn AcknowledgmentsThanks to all contributors, linter devs, syntax refiners, parser maintainers, and Ethereum’s Solidity team. Special thanks to those who created the original Sublime and server tools that helped bootstrap this extension. |