Use abi.encodeWithSignature together with raw call() (#1008)
This commit is contained in:
committed by
Francisco Giordano
parent
78e39aa2ad
commit
b4406d385f
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user