Created
August 8, 2022 12:40
-
-
Save ylv-io/59f415f2ca1e115e7b0526130bf467d5 to your computer and use it in GitHub Desktop.
Force a smart contract to receive ETH
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.1; | |
/** | |
* @title ShutUpAndTakeMyMoney | |
* @dev Force target to accept msg.value amount of ETH | |
* https://docs.soliditylang.org/en/v0.8.13/introduction-to-smart-contracts.html?highlight=selfdestruct#deactivate-and-self-destruct | |
*/ | |
contract ShutUpAndTakeMyMoney { | |
constructor(address _target) payable { | |
selfdestruct(payable(_target)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment