• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A VSCode extension offering utilities for solidity smart-contract development.

VSCode Solidity Inspector • 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 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's scaffold command.
  • Auto-complete path suggestions for importing files and dependencies (with forge remappings support).

Requirements

The following will need to be installed in order to use this template. Please follow the links and instructions.

  • Foundry / Foundryup

    • 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

    • 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: <ACTION>
  • From the command pallet: Press Cmd + Shift + P -> Search Solidity Inspector - <ACTION>

Highlights unused imports:

vscode-unused.mp4

Generate foundry deployment report:

deployment-report-demo-mp4.mp4

Support for .tree files and test stub generation:

Screen.Recording.2023-11-03.at.9.59.05.PM.mov

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.


For more demos, see ./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.

More Repositories

1

huffbound

A Soulbound token contract implementation using Huff
Solidity
36
star
2

huff-goo-issuance

GOO(Gradual Ownership Optimization) issuance implementation using Huff
Solidity
34
star
3

smol-evm-rs

☄️ A toy implementation of the EVM from scratch using Rust.
Rust
31
star
4

node-authentication-jwt-mongodb

A simple and secure implementation of REST API using Node.js and MongoDB with JSON Web Tokens which can be used for user authentication.
JavaScript
27
star
5

huff-math

This repo contains smart contract to perform basic arithmetic operations implemented using Huff
Solidity
24
star
6

cryptocurrency-price-alert

This is a service built using NodeJS, ExpressJS, BullMQ, etc to set alerts for cryptocurrency prices. Users will recieve email notification if the current price goes above/below the threshold.
JavaScript
16
star
7

yul2huff

A simple tool to convert Yul arithmetic expressions to Huff
CSS
14
star
8

foundry-faucet

This is a simple project that demonstrates testing and deployment using `forge`
Solidity
13
star
9

awesome-upgradeability

A curated list of awesome resources and projects that concern smartcontract upgradeability
13
star
10

uups-proxy

This repo contains a simple implmentation of the UUPS proxy pattern
JavaScript
10
star
11

huff-stuff

Random Huff snippets
Solidity
9
star
12

vscode-foundry-test-runner

Foundry test runner to view and run tests directly from the VSCode editor
TypeScript
7
star
13

node-express-api-starter

Spin up an Express server within minutes and build robust APIs using this starter template (or boilerplate).
JavaScript
5
star
14

crypto-trading-bot

This is a customizable sentiment based cryptocurrency trading bot built using NodeJS
JavaScript
5
star
15

huffathon-challenge-2

The Lost temple of Ethereum
Solidity
2
star
16

sushi-update-pools-simulation

Simulates a call to Sushi's `massUpdatePool()` method, which uses about 1M gas
TypeScript
2
star
17

structured-products-core

This repository contains the Smart contracts for the Structured products MVP/Prototype which is built for Chainlink Fall Hackathon 2021.
Solidity
1
star
18

forge-template

This is a template to quickly setup a project using Forge
Solidity
1
star
19

ens-bound-badges

ENS bound non-transferrable on-chain badges implemented for ETHIndia'22. Won multiple sponsor prizes 🏆
Solidity
1
star