Last active
February 11, 2022 11:44
-
-
Save maymax777/ab0e3507fa0d6479a092a616daa553e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract Staking { | |
function isContract(address _target) internal view returns (bool) { | |
if (_target == address(0)) { | |
return false; | |
} | |
uint256 size; | |
assembly { | |
size := extcodesize(_target) | |
} | |
return size > 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment