I have created the following contract with a destroy function invoking selfdestruct:
pragma solidity >=0.5.0 < 0.7.0;
contract Terminate{
function destroy() public {
selfdestruct(msg.sender);
}
}
$ truffle consoletruffle(development)>
undefined truffle(development)> T = await Terminate.at('0xA79abEbDb5396053aC4Be4b73282fFef060e410A'); undefined truffle(development)> await T.destroy(); { tx: '0xaaf88fb64a0531d4dd708bbd58908cbf931549519ddbf5e7c5cea40ff30a7bc7',
Now if I try to call 'destroy()', it would be again executed. I thing I must get some error message because I have already destroyed the contract.
truffle(development)> await T.destroy(); { tx:
'0x96166648453aa8653c194e055590849e6bef028ef6017e3e894690b3270f3ff4', receipt: { transactionHash: '0x96166648453aa8653c194e055590849e6bef028ef6017e3e894690b3270f3ff
Why I couldn't destroy the contractusing my earlier call to destroy?
I have stored a copy of the contract in the Github:
Somebody please guide me how to kill the contract using selfdestruct?
Zulfi.