crytic / crytic/slither

how the read-write analysis works for loops

Open
#1,944 6 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

When slither generates IFLOOP node, it has every read and write from its body.

### Code example to reproduce the issue:

```solidity
contract A {
function foo() public pure {
int i = 4;
while (i < 4) {
i++;
}
}
```
```python
>>> from slither import Slither
>>> foo = Slither('a.sol').contracts[0].functions[0]
>>> print(foo.nodes[3])
IF_LOOP i < 4
>>> print(foo.nodes[3].variables_written[0])
i
```

### Version:

0.9.3

### Relevant log output:

_No response_

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.