False Positive on Public Enums
See original GitHub issueMythril 0.18.4 reports false positive on public enum storage variables.
pragma solidity ^0.4.19;
contract Benchmark {
enum State {
s1
}
State public state;
}
==== Exception state ====
Type: Informational
Contract: Unknown
Function name: _function_0xc19d93fb
PC address: 100
A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. This is acceptable in most situations. Note however that `assert()` should only be used to check invariants. Use `require()` for regular input checking.
--------------------
In file: public_storage_enum.sol:7
State public state
--------------------
```
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
False positive 'Enums may not include properties' if constant ...
False positive 'Enums may not include properties' if constant references to enum's case ; Project, PhpStorm ; Priority, Normal N ; Type, Bug...
Read more >Enum assignability false positive · Issue #29879 - GitHub
No compiler error. The pattern seems to be that the enum will be assignable if: Both enum types have the same name ("Color"...
Read more >CA1027: Mark enums with FlagsAttribute (code analysis) - .NET
To reduce false positives, this rule does not report a violation for enumerations that have contiguous values.
Read more >Enum.name() should be an exception to S2629
In the specific case of an enum name, this is a false positive. The enum name is stored in the implicit parent class...
Read more >1480 [java] UnusedModifier - PMD Issues - SourceForge
#1480 [java] UnusedModifier: false positive on public modifier used with inner interface in enum ; Priority: 3-Major ; Type: Bug ; Ruleset /...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is a related thought regarding this. With interaction with static analysis we can know this is an enum and adjust severity. The ethereum best practices guide says that smaller datatypes like int8’s are more vulnerable than int256’s. But on the other hand, if we can do some static analysis and determine this is boilerplate code, that might change things drastically. Dunno yet.
Of course, the false positive should get tracked down.
@chronaeon I’m not sure about that. The different false positives might be caused by different aspects in mythril. So we’d need to validate/triage them first to see if they are the same false positive. If two false positives have the same root cause, I’m fine with merging them