Simplify selector access (#2766)

This commit is contained in:
Anton Bukov
2021-07-13 02:23:14 +03:00
committed by GitHub
parent 973b0f883a
commit 4e2641a915
4 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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));