Fix issues caused by abi.decode reverting (#3552)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
(cherry picked from commit 628a6e2866)
This commit is contained in:
committed by
Francisco Giordano
parent
8c49ad74ea
commit
212de08e7f
@ -35,6 +35,8 @@ library SignatureChecker {
|
||||
(bool success, bytes memory result) = signer.staticcall(
|
||||
abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
|
||||
);
|
||||
return (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector);
|
||||
return (success &&
|
||||
result.length == 32 &&
|
||||
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,6 +108,6 @@ library ERC165Checker {
|
||||
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
|
||||
(bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams);
|
||||
if (result.length < 32) return false;
|
||||
return success && abi.decode(result, (bool));
|
||||
return success && abi.decode(result, (uint256)) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user