Questions tagged [selfdestruct]

opcode for deleting a contract, original opcode called SUICIDE

Filter by
Sorted by
Tagged with
4
votes
1answer
308 views

Question about suicide traces in Parity

I use Parity's trace facility extensively to help me account for all transactions on individual accounts. I've been able to get almost complete accuracy (off-chain) of account balances for each block, ...
0
votes
0answers
531 views

“callback contain no result Error: Error: base fee exceeds gas limit” when call selfdestruct function (using Remix IDE)

I'm testing this simple contract. All the functions works well, but when I call the kill() function I'm getting this error: callback contain no result Error: Error: base fee exceeds gas limit I'm ...
3
votes
3answers
3k views

How to kill crowdsale contract?

I want to just simply kill this contract what code do i type into the get console to kill this contract so that the funds are returned to the owner which is me. Please let me know how you did it so I ...
1
vote
1answer
197 views

Self destruct to multiple parties?

var endval = this.balance / 2; counterparty1.send(endval); counterparty2.send(endval); selfdestruct(creator); Is there anyway to selfdestruct to two parties? I have the code above, but now you ...
0
votes
1answer
59 views

Where can I find the source code for selfdestruct()?

I'm trying to look into the Ethereum repository but I can't find a file for the functions. I want to know how selfdestruct() is implemented, but I also would like to look at other functions.
7
votes
1answer
4k views

how can a contract destroy other contract (suicide accounts)?

I learnt from the yellowpaper that at the end of a contract execution, there could be a list of suicide accounts that will be removed. my question is, why and how would one smart contract remove ...
2
votes
0answers
316 views

how can I detect if an address contained a contract that called selfdestruct?

I would like to create a web3-based JS function like this: function hasSelfDestructed(address) { if (... address was a contract, but has called selfdestruct ...) return true else return ...
3
votes
1answer
179 views

Why are there multiple suicide calls from one address to a contract in the same block?

There are several contracts whose internal Tx have only suicide calls from the same contract/user address over and over again. What is the need of having multiple calls?
2
votes
1answer
263 views

Can I redeploy a previous self-destructed smart contract?

If I deploy a smart contract, and then self destruct it. Then later send it ether by mistake, can I re-deploy it and be able to access that "lost" ether through the smart contract?
1
vote
2answers
168 views

Does not killing an old contract bloat the blockchain?

I deployed and tested a contract (on testnet, but the same question goes for mainnet too), now I'm finished with it, moved on to new contracts. Should I remove the old one? Does it do any harm, ...
9
votes
1answer
311 views

How was the state-bloat attack that led to the EIP 150 hardfork performed?

I understand that SELFDESTRUCT and mispricing of opcodes allowed many empty accounts to be created cheaply as explained in Why were empty accounts allowed to be on the blockchain? The answer to that ...
12
votes
3answers
5k views

Contract's state after a Selfdestruct

What happens to the state of a smart contract when it is selfdestruct. Are the last state variables still visible on the blockchain afterwards?
3
votes
2answers
168 views

Is a race possible when checking the contract for liveness?

I wonder if a race is possible when performing a check of a return value of a call similar to eth.getCode(greeter.contractAddress) for being zero. That is, is it possible that the contract was alive ...
24
votes
6answers
20k views

How can I return struct when function is called?

I'd like to return struct type User. However, when I tried the following getUser function, it returns an error. Is there any way that struct data would be returned from a function? Contract struct ...
7
votes
1answer
146 views

Is a suiciding contract susceptible to re-entrancy?

If my contract calls suicide() referencing a contract as the recipient of funds, and that recipient contract default function calls back into my contract, will the call succeed? contract A { ...
3
votes
1answer
273 views

Should governance and token smart contracts be “unstoppable” or upgradeable? [closed]

Selfdestruct (aka suicide) functions stop contracts from functioning and clean up data on the blockchain. They can be used in upgrading contracts. Selfdestructing and upgradable contracts using a ...
8
votes
1answer
215 views

When does a SUICIDE opcode becomes effective?

The documentation (https://github.com/ethereum/wiki/wiki/Subtleties) states that SUICIDE becomes effective at the end of the transaction, but in block 116525, the same contract was able to SUICIDE ...
7
votes
3answers
1k views

What is actually removed during a contract suicide, and why doesn't this cause the blockchain to change?

I'm trying to get my head around how contract suicides work, and what actually happens during them. I understand why we use them. This post states that when the SUICIDE opcode is executed, the data ...
46
votes
5answers
22k views

Why are selfdestructs used in contract programming?

I'm reading bits and pieces that selfdestructs within contracts are a good thing. Can someone explain what the benefits are of doing a contract selfdestruct when it comes to Ethereum programming? Is ...

1
2