Last active
January 3, 2023 07:09
-
-
Save Jesserc/2d3fd07eecf78ce4b363453ac484416b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract rejectContracts { | |
| function isContract(address account) public view returns (bool) { | |
| uint256 size; | |
| assembly { | |
| size := extcodesize(account) | |
| } | |
| return size > 0; | |
| } | |
| function TakeAllTheMoney(address account) public { | |
| require(!isContract(account), "Error: no contract allowed"); | |
| payable(account).transfer(address(this).balance); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment