Loading...
This method can not erase information stored prevously on the Blockchain. It will simply update the current state so that nobody can interact with the destroyed smart contrant address anymore. Data or transactions previously happened on blockchain can still be accessible but interaction is not possible.
Selfdestruct function will destroy the smart contract and send any ethers in it to given address.
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract Destroy_SC {
address public owner;
constructor() {
owner = msg.sender;
}
function destroy_smart_contract(address payable _to) public {
require(msg.sender == owner, "Owner Function Only");
selfdestruct(_to);
}
}