Use abi.encodeWithSignature together with raw call() (#1008)

pull/995/head^2
chriseth 7 years ago committed by Francisco Giordano
parent 78e39aa2ad
commit b4406d385f
  1. 3
      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);
}
}

Loading…
Cancel
Save