crytic / crytic/slither

[Bug]: Body of Vyper functions that start with `pass` are not analysed

Open
#2,192 0 comments 0 reactions 0 assignees View on GitHub
bug vyper
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

Hi, really cool to have Vyper in Slither :)

When a function starts with the `pass` statement, it seems that Slither is considering it as a non-implemented interface and omits to analyse the content of the function, hence potentially leading to false positive/false negative
Probably caused by:
https://github.com/crytic/slither/blob/e3dcf1ecd3e9de60da046de471c5663ab637993a/slither/vyper_parsing/declarations/function.py#L183

### Code example to reproduce the issue:

```Vyper
var:uint256

@internal
def bar(a:uint256):
pass
self.var = 2

@external
def foo():
self.bar(2)

```

### Version:

0.10.0

### Relevant log output:

```shell
INFO:Detectors:
code2 (code2.vy#1-10) does not implement functions:
- code2.bar() (code2.vy#4-6)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unimplemented-functions
INFO:Detectors:
code2.var (code2.vy#1) is never used in code2 (code2.vy#1-10)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unused-state-variable
INFO:Detectors:
code2.var (code2.vy#1) should be constant
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-constant
INFO:Slither:code2.vy analyzed (1 contracts with 93 detectors), 3 result(s) found
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.