add test showing two internal call example is caught

pull/2340/head
alpharush 9 months ago
parent 04ff85fd65
commit 75c1159d73
  1. 1
      slither/detectors/functions/out_of_order_retryable.py
  2. 4
      tests/e2e/detectors/snapshots/detectors__detector_OutOfOrderRetryable_0_8_20_out_of_order_retryable_sol__0.txt
  3. 6
      tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol
  4. BIN
      tests/e2e/detectors/test_data/out-of-order-retryable/0.8.20/out_of_order_retryable.sol-0.8.20.zip

@ -72,6 +72,7 @@ Bob calls `doStuffOnL2` but the first retryable ticket calling `claim_rewards` f
key = "OUTOFORDERRETRYABLE"
# pylint: disable=too-many-branches
def _detect_multiple_tickets(
self, function: FunctionContract, node: Node, visited: List[Node]
) -> None:

@ -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)

@ -90,7 +90,11 @@ function bad3() external {
0,
"");
good2();
}
}
function bad4() external {
good2();
good2();
}
function good2() internal {
Y(msg.sender).createRetryableTicket(
address(2),

Loading…
Cancel
Save