Created
February 2, 2023 11:55
-
-
Save bartubozkurt/af113a0e2dabc4244708b8e6d02ec789 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
/* Bad */ | |
modifier isNotContract(address _a){ | |
uint len; | |
assembly { len := extcodesize(_a) } | |
require(len == 0); | |
_; | |
} | |
/* Better */ | |
modifier isNotContract(address _a){ | |
(tx.origin == msg.sender,"No Contract"); | |
_; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment