Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PraneshASP/vscode-solidity-inspector
A VSCode extension offering utilities for solidity smart-contract development.
https://github.com/PraneshASP/vscode-solidity-inspector
evm solidity vscode-extension
Last synced: 3 months ago
JSON representation
A VSCode extension offering utilities for solidity smart-contract development.
- Host: GitHub
- URL: https://github.com/PraneshASP/vscode-solidity-inspector
- Owner: PraneshASP
- License: mit
- Created: 2022-10-11T18:48:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-23T14:05:12.000Z (4 months ago)
- Last Synced: 2024-07-23T22:33:49.796Z (4 months ago)
- Topics: evm, solidity, vscode-extension
- Language: JavaScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=PraneshASP.vscode-solidity-inspector
- Size: 44.7 MB
- Stars: 123
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- On-Chain-Investigations-Tools-List - A VSCode extension for inspecting solidity smartcontracts using Forge
README
# VSCode Solidity Inspector • [![license](https://img.shields.io/badge/MIT-brown.svg?label=license)](https://github.com/PraneshASP/vscode-solidity-inspector/blob/main/LICENSE)
An extension for VSCode editor that offers multiple utilities to work with the Solidity smart-contracts.
> Note: This extension is not tested across multiple platforms yet. Only the contracts under foundry project are supported for now.
---
## Motivation:
0age 👑 dropped the optimization alpha in his [tweet](https://twitter.com/z0age/status/1578443876615929857) and when I tried it out for the first time I thought it was really a cool trick. The tweet has the configuration only for hardhat projects. But forge helps to do the same thing in a single command. So I thought instead of typing out the command for each contract in the CLI, it would be handy for the buildooors if there's an extension to inspect solidity contracts and generate low-level code for the contracts. The o/p generated is very useful for gas optimizations. Later I started adding more features to this extension.
TL;DR, this is my first VSCode extension, so feel free to provide feedback as I know that there's a plenty of room for improvements, as always^^
### Features at a glance:
- Forge ir-optimized o/p generation for the current file (or) selected file(s).
- Forge asm-optimized o/p generation for the current file (or) selected file(s).
- Forge storage-layout o/p generation for the current file (or) selected file(s).
- Flatten current file (or) selected file(s).
- Inline highlighting in code editor for unused imports.
- Generate and view Foundry deployment report in a clean and concise table format.
- Syntax highlighting of for `.tree` files.
- Generate foundry test stub using [bulloak](https://github.com/alexfertel/bulloak)'s `scaffold` command.
- Auto-complete path suggestions for importing files and dependencies (with forge remappings support).
- Inline code-separator suggestion (solmate and solady style)
- Contract code size decorator.---
## Requirements
The following will need to be installed in order to use this template. Please follow the links and instructions.
- [Foundry / Foundryup](https://github.com/gakonst/foundry)
- This will install `forge`, `cast`, and `anvil`
- You can test you've installed them right by running `forge --version` and get an output like: `forge 0.2.0 (f016135 2022-07-04T00:15:02.930499Z)`
- To get the latest of each, just run `foundryup`- [Bulloak](https://github.com/alexfertel/bulloak)
- This is required to generate test stub from `.tree` spec files.
---## Usage
The usage of this extension is straightforward.
- From the context menu: Select file(s) -> Right click -> `SolidityInspector: `
- From the command pallet: Press `Cmd + Shift + P` -> Search `Solidity Inspector - `---
#### Highlights unused imports:
https://github.com/PraneshASP/vscode-solidity-inspector/assets/42379522/e4906ad3-69e6-4cea-b986-7712ec342fca
---
#### Generate foundry deployment report:
https://github.com/PraneshASP/vscode-solidity-inspector/assets/42379522/cfaf987e-ad91-4927-9042-7562bc8684dc
---
#### Support for `.tree` files and test stub generation:
https://github.com/PraneshASP/vscode-solidity-inspector/assets/42379522/2a3d591b-bc80-46cc-88c9-7e4faa0bb043
---
#### File import auto-complete suggestions (with forge remappings support):
> [!TIP]
> If you have updated your remappings.txt file, you can press `CMD+CTRL+X` to refresh remappings.![](./assets/auto-import.gif)
---
#### Inline separator suggestions:
[![]()](https://github.com/user-attachments/assets/abbbd466-520f-464e-aa59-1ba628a57d18)
---
#### Inline contract size decoration:
> [!TIP]
> This uses the `deployedBytecode` object from the build file. So it will get updated only after every build. This setting can be also turned on/off via the extension settings.![](./assets/inline-contract-size.png)
---
> [!NOTE]
> For more demos, see [./assets](https://github.com/PraneshASP/vscode-solidity-inspector/tree/main/assets)## Contributing
Contributions are welcomed. Any contributions you make are **greatly appreciated**.
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request## Disclaimer
_The outputs generated are not always safe for production usage. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the result. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk._