Skip to content

Commit

Permalink
Merge pull request #36 from tintinweb/feat/vyper_0.4.0_support
Browse files Browse the repository at this point in the history
feat: vyper 0.4.0 support
  • Loading branch information
tintinweb authored Jul 3, 2024
2 parents 796a2d1 + 3df08ea commit d45d24e
Show file tree
Hide file tree
Showing 26 changed files with 2,008 additions and 3,721 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ typings/
# DynamoDB Local files
.dynamodb/

dist/**
dist/**

# VSCode
.vscode/

# OSX
.DS_Store
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Change Log

## 0.1.0
- new: logo for Vyper files in the explorer view
- fix: compilation for Vyper 0.4.x
- fix: don't compile interface files
- fix: correct static built-in hover information to match Vyper
- fix: prevent function decorator from being highlighted when used in a comment
- updated snippets to Vyper 0.3.x and 0.4.x
- updated language spec fetcher to Vyper 0.4.x
- updated syntax highlighting to Vyper 0.4.x
- updated the Vyper logo
- updated the banner theme on the marketplace to match Vyper colors
- removed MythX

## 0.0.15
- fix: typo in snippet `funcnonreentrant` #25

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ Note: Active features can be disabled by setting `Settings` → `Vyper` → `Mod
* Provides Security augmented decorations (`Settings``Vyper``Decoration: Enable`)
* Provides Hover information (`Settings``Vyper``Hover: Enable`)
* Provides Code snippets for common language constructs
* Integrates with the vyper compiler (based on `truffle-compile-vyper`)
* Integrates with the vyper compiler
* automatically compile contracts on save (`Settings``Vyper``Compile: On Save`)
* compilation can be triggered by executing a vscode command (`cmd + shift + p``Vyper: Compile`)
* vyper location/command can be customized (default assumes `vyper` is in `PATH`) (`Settings``Vyper``Command`)
* Integrates with [MythX](https://www.mythx.io/#faq)
* [sign-up](https://www.mythx.io/#faq) with your ethereum address (username)
* set your username and password (`Settings``Vyper``MythX: Ethaddress` / `Settings``Vyper``MythX: Password` or `env.MYTHX_ETH_ADDRESS` / `env.MYTHX_PASSWORD`; configuration takes precedence)
* automatically analyze for security issues when saving the file (`Settings``Vyper``Analysis: On Save`)


## Requirements

* It is assumed that vyper is installed and generally available on the system (`pip install vyper`). In case vyper is not available in path or called in a virtualenv configure the vyper command in `Settings``Vyper``Command`
* It is assumed that vyper is installed and generally available on the system (`pip3 install vyper`). In case vyper is not available in path or called in a virtualenv configure the vyper command in `Settings``Vyper``Command`

## Tour

Expand Down Expand Up @@ -69,7 +65,7 @@ Note: Active features can be disabled by setting `Settings` → `Vyper` → `Mod

#### Snippets

* Quickly create `constructor`, `fallback` function, `methods`, `structs`, ... as you type. Select the snippet from the suggestion box. See [snippets/vyper.json](./snippets/vyper.json) for a list of available snippets.
* Quickly create `constructor`, `fallback` function, `methods`, `structs`, ... as you type. Select the snippet from the suggestion box. See [snippets/](./snippets/) for a list of available snippets.
* start typing ...

<img width="600" alt="image" src="https://user-images.githubusercontent.com/2865694/54860223-6e340400-4d17-11e9-8b21-49deed0db4db.png">
Expand All @@ -87,6 +83,12 @@ Note: Active features can be disabled by setting `Settings` → `Vyper` → `Mod
* **Q**: I get an error running vyper on my macbook with M1/M2 chipset.
* **A**: The extension executes the vyper compiler in a `/bin/sh` shell that may not have all the customizations you are using in your day-to-day shell/terminal. As a workaround, I suggest to set the setting:`vyper.command` to `arch -x86_64 vyper`. see #18

* **Q**: My project uses Vyper 0.3.x and import some interfaces from other contracts. but the extension does not recognize them and output `FileNotFoundError: Cannot locate interface 'interface/my_interface{.vy,.json}`.
* **A** The extension compiles your file with the command `vyper`. You should set the setting: `vyper.command` to `vyper -p path/to/your/project/directory` to make the compiler aware of the interfaces in your project.

* **Q** My multi-module project uses Vyper 0.4.x and while the extension does not report compilation error for any files, when compiling the project with the Vyper cli or some framework such as `ape`, `foundry` or `titanoboa`, it fails with some issue about modules usage/initialization.
* **A** In 0.4.x, A Vyper modules might be valid when being imported but not a valid standalone contracts to compile into bytecode. Hence the extension stops the compilation at the ``annotated_ast` phase, before the global constraint checker. For more info see https://github.com/vyperlang/vyper/pull/3810.

## Developer Notes

* install vyper `pip3 install vyper`
Expand Down
Binary file removed images/.DS_Store
Binary file not shown.
Binary file modified images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon_small_with_border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d45d24e

Please sign in to comment.