VS Code Forge Snippets

Forge Snippets for VS Code.

Installation

Installation is fairly easy, you just need to open (or create) the solidity snippet file in VS Code.

  1. Open the command palette cmd + shift + p in Mac or ctrl + shift + p on Windows
  2. Copy the content of the soliditySnippets.json file.
  3. Paste it into the solidity snippet in VS Code.

8

Snippets

Here is the list of current supported snippets.

Init

Simple boilerplate structure for a test contract.

1

Script

Simple boilerplate structure for a script contract.

script

Event

A simple event.

2

SetUp

SetUp function snippet.

3

Test

Test function boilerplate.

4

Prank Cheatcodes

Snippets for prank, startPrank, StopPrank and Deal cheatcodes.

5

Expect Event

Snippet for emit and expect event emition.

6

Expect Revert

Snippet for revert checks.

7