Skip to content

Commit

Permalink
add test showing two internal call example is caught
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed Feb 29, 2024
1 parent 04ff85f commit 75c1159
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions slither/detectors/functions/out_of_order_retryable.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class OutOfOrderRetryable(AbstractDetector):

key = "OUTOFORDERRETRYABLE"

# pylint: disable=too-many-branches
def _detect_multiple_tickets(
self, function: FunctionContract, node: Node, visited: List[Node]
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Multiple retryable tickets created in the same function:
-Y(msg.sender).createRetryableTicket(address(1),0,0,address(0),address(0),0,0,) (tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol#62-70)
-Y(msg.sender).createRetryableTicket(address(2),0,0,address(0),address(0),0,0,) (tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol#72-80)

Multiple retryable tickets created in the same function:
-good2() (tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol#95)
-good2() (tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol#96)

Multiple retryable tickets created in the same function:
-Y(msg.sender).createRetryableTicket(address(1),0,0,address(0),address(0),0,0,) (tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol#40-48)
-Y(msg.sender).createRetryableTicket(address(2),0,0,address(0),address(0),0,0,) (tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol#50-58)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ function bad3() external {
0,
"");
good2();
}
}
function bad4() external {
good2();
good2();
}
function good2() internal {
Y(msg.sender).createRetryableTicket(
address(2),
Expand Down
Binary file not shown.

0 comments on commit 75c1159

Please sign in to comment.