From b4406d385fd2ce9cc6e72a51dc57a739171633b1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 14 Jun 2018 23:50:39 +0200 Subject: [PATCH] Use abi.encodeWithSignature together with raw call() (#1008) --- contracts/mocks/ReentrancyMock.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/mocks/ReentrancyMock.sol b/contracts/mocks/ReentrancyMock.sol index 4972098b2..84cabe1f3 100644 --- a/contracts/mocks/ReentrancyMock.sol +++ b/contracts/mocks/ReentrancyMock.sol @@ -24,11 +24,10 @@ contract ReentrancyMock is ReentrancyGuard { } function countThisRecursive(uint256 n) public nonReentrant { - bytes4 func = bytes4(keccak256("countThisRecursive(uint256)")); if (n > 0) { count(); // solium-disable-next-line security/no-low-level-calls - bool result = address(this).call(func, n - 1); + bool result = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1)); require(result == true); } }