1

I want to know if calling selfdestruct clears/removes data from blockchain or it still remains there.

Looking at this link, CLICK HERE it says that data doesn't get removed. (first answer)

Looking at this link, CLICK HERE it says that it frees up the data. (first answer)

Question 1) So, which one is right ? Does the data get removed or not ? what gets removed exactly ?

Question 2) If I send the ether directly or transfer, to the contract that already used selfdestruct, will it return false and my ether coming back to me or ether will get burn ? if it burns and gets lost, then the idea that

" selfdestruct exists because no one can interact it with it anymore so that no dangerous thing could happen "

seems to be a little bit wrong...

1

The data gets removed from that block onwards. So the history of the blockchain is never touched. If you look at the blockchain before the block (in which the selfdestruct was called) you see the contract in its address. But if you look at the same address after that block there is no contract.

You can send Ethers to whichever address you wish and it will succeed (unless there's a contract which reverts the transaction) and the Ether will remain in that address. So you can send Ethers to an address which used to be a contract address and the Ethers are effectively burned as there can't be another contract at that address anymore.

Your note about "no dangerous thing could happen" is partially true, depending on the point of view. Calling a non-existent contract will leave the Ethers there but will return immediately. So in that sense it's dangerous to self-destruct a contract as any subsequent Ethers sent to it will get burned. But on the other hand the contract can't do any mischief (such as re-entrancy attacks) if it's being called as there is no contract anymore - although this probably doesn't give you much comfort if you lose your Ethers there. (Check https://ethereum.stackexchange.com/a/1436/31933 for details)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.