crytic / crytic/slither

False positives in upgradeability checks ```order-vars-proxy``` and ```order-vars-contract```

Open
#881 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

The upgradeability checks ```order-vars-proxy``` and ```order-vars-contract``` detect false positives when comparing variables of the types Structure, Literal, ArrayType, Contract (there may be more I haven't encountered yet).

These classes are either missing an ```__eq__(self, other)``` method or else the method's implementation is incomplete. This results in the comparison ```variable1.type != variable2.type``` always returning True for these types, presumably because it is comparing the pointers to two different (yet identical) Type objects.

I have resolved the issues with the classes listed above in my local copy of Slither by implementing the equals methods. I plan to create a pull request soon.

Discovered and tested using the three versions of the VNFTx contract contained in the following .zip:
[VNFTx.zip](https://github.com/crytic/slither/files/6757318/VNFTx.zip)

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.