ConsenSysDiligence / ConsenSysDiligence/scribble
Warn users when annotations may add inifinte loops
- Dominant language
- TypeScript
- Stars
- 334
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Instrumentation turns the following terminating code into non-terminating code:
```solidity
contract Foo {
function double1(uint x) public view returns (uint) {
return double2(x);
}
/// if_succeeds $result == double1(x);
function double2(uint x) public view returns (uint) {
return x + x;
}
}
```
We can use the callgraph of the original code to detect when function calls in the annotations may create cycles and issue warnings for users that the annotations may introduce infinite recursion. For example this check shouldn't flag anything in the following sample:
```solidity
contract Foo {
/// if_succeeds $result == double2(x);
function double1(uint x) public view returns (uint) {
return x * 2;
}
/// if_succeeds $result == double1(x);
function double2(uint x) public view returns (uint) {
return x + x;
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.