Avoid returnbomb in ERC165Checker (#3587)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>pull/3592/head
parent
8ea1fc87c9
commit
dc4869eb23
@ -0,0 +1,18 @@ |
||||
// SPDX-License-Identifier: MIT |
||||
|
||||
pragma solidity ^0.8.0; |
||||
|
||||
import "../../utils/introspection/IERC165.sol"; |
||||
|
||||
contract ERC165ReturnBombMock is IERC165 { |
||||
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { |
||||
if (interfaceId == type(IERC165).interfaceId) { |
||||
assembly { |
||||
mstore(0, 1) |
||||
} |
||||
} |
||||
assembly { |
||||
return(0, 101500) |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue