Solidity language server providing smart contract development support including compilation, linting, security analysis, and code intelligence for .sol files. Use when working with Ethereum smart contracts, Substrate pallets, or any Solidity code that needs compilation, security checks, gas optimization, or code navigation. Essential for ClawChain pallet development.
Solidity language server integration providing comprehensive smart contract development support through solc (Solidity compiler) and solhint (linter).
.solInstall Solidity compiler and linter:
# Solidity compiler
npm install -g solc
# Solidity linter
npm install -g solhint
Verify installation:
solcjs --version
solhint --version
solcjs --bin --abi contract.sol
Compile with optimization:
solcjs --optimize --bin --abi contract.sol
Run solhint on a file:
solhint contracts/MyContract.sol
Run on entire project:
solhint 'contracts/**/*.sol'
solhint includes security rules by default. For advanced security analysis, consider:
# Install slither (requires Python)
pip3 install slither-analyzer
# Run security analysis
slither contracts/
Create .solhint.json in project root:
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "^0.8.0"],
"func-visibility": ["warn", {"ignoreConstructors": true}],
"max-line-length": ["warn", 120],
"not-rely-on-time": "warn",
"avoid-low-level-calls": "warn",
"no-inline-assembly": "warn"
}
}
For full development environments, see references/frameworks.md.
When developing smart contracts:
solhint to catch issues earlysolcjs to verify compilationview/pure where possibletx.origin for authenticationreferences/frameworks.md for Hardhat/Foundry setup