Toolverse
All skills

solidity-lsp

by openclaw

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

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
openclaw
Category
Testing

About this skill

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.

How to use

  1. Zainstaluj kompilator Solidity (solc) i linter (solhint) globalnie za pomocą npm: npm install -g solc oraz npm install -g solhint. Zweryfikuj instalację uruchamiając solcjs --version i solhint --version.

  2. Aby skompilować kontrakt, użyj komendy solcjs --bin --abi contract.sol. Jeśli chcesz włączyć optymalizację, dodaj flagę --optimize: solcjs --optimize --bin --abi contract.sol.

  3. Uruchom linter na pojedynczym pliku komendą solhint contracts/MyContract.sol. Aby przeskanować cały projekt, użyj wzorca: solhint 'contracts/**/*.sol'.

  4. Dla zaawansowanej analizy bezpieczeństwa zainstaluj slither-analyzer (wymaga Pythona): pip3 install slither-analyzer, a następnie uruchom slither contracts/.

  5. Skonfiguruj reguły lintingu tworząc plik .solhint.json w katalogu głównym projektu. Użyj predefiniowanej konfiguracji "solhint:recommended" i dostosuj reguły, takie jak compiler-version czy func-visibility, do wymagań Twojego projektu.

  6. Zintegruj narzędzie z edytorem obsługującym Language Server Protocol, aby uzyskać podświetlanie składni, detekcję błędów w czasie rzeczywistym i nawigację po kodzie podczas pisania kontraktów.

Related skills