Simplify selector access (#2766)
This commit is contained in:
@ -24,7 +24,7 @@ library SignatureChecker {
|
||||
) internal view returns (bool) {
|
||||
if (Address.isContract(signer)) {
|
||||
try IERC1271(signer).isValidSignature(hash, signature) returns (bytes4 magicValue) {
|
||||
return magicValue == IERC1271(signer).isValidSignature.selector;
|
||||
return magicValue == IERC1271.isValidSignature.selector;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ library ERC165Checker {
|
||||
* Interface identification is specified in ERC-165.
|
||||
*/
|
||||
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
|
||||
bytes memory encodedParams = abi.encodeWithSelector(IERC165(account).supportsInterface.selector, interfaceId);
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user