Skip to content

Commit b4406d3

Browse files
chrisethfrangio
authored andcommitted
Use abi.encodeWithSignature together with raw call() (#1008)
1 parent 78e39aa commit b4406d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contracts/mocks/ReentrancyMock.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ contract ReentrancyMock is ReentrancyGuard {
2424
}
2525

2626
function countThisRecursive(uint256 n) public nonReentrant {
27-
bytes4 func = bytes4(keccak256("countThisRecursive(uint256)"));
2827
if (n > 0) {
2928
count();
3029
// solium-disable-next-line security/no-low-level-calls
31-
bool result = address(this).call(func, n - 1);
30+
bool result = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1));
3231
require(result == true);
3332
}
3433
}

0 commit comments

Comments
 (0)