False positive "reachable exception" on fallback function
See original GitHub issueI’m getting a false positive on a few contracts that don’t have a fallback function declared.
Here’s the report output:
Exception state
- Type: Informational
- Contract: Vault
- Function name:
_function_0x43d726d6
- PC address: 979
Description
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 Vault.json:44
state == _state
Note that the given source code corresponds to a modifier with require(state == _state_)
, not assert.
Two situations I see there are here:
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Why does fallback cause exception when expecting return ...
Have a look at this excerpt from a fallback function in a proxy contract. It offers no expectation about the return data size...
Read more >Ethereum Smart Contract Security Recommendations
From how to handle external calls to commitment schemes, here are 10+ smart contract security patterns to follow when you're building on Ethereum....
Read more >Oracle-Supported Dynamic Exploit Generation for Smart ...
Fallback Function. The fallback function is an important mechanism in Ethereum and is highly relevant to the reentrancy and exception disorder vulnerabilities.
Read more >Model Optimizer Frequently Asked Questions
A : Model Optimizer cannot infer shapes or values for the specified node. It can happen because of the following reasons: a bug...
Read more >arXiv:1901.01292v2 [cs.CR] 21 Jan 2019
Our approach does not produce false positives for safety properties ... Solidity fallback functions are further discussed in Appendix C.1.
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 Free
Top 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
In both cases out-of-bounds array access can cause an exception.
^^ Out-of-bounds-access in the automatically generated getter function.
@b-mueller I don’t think so. In that case it will simply set it. In solidity everything is set to default if it does not exists