Skip to main content

SuicidesSelfdestructs in Ethereum are an operation (an OPCODE actually) at the EVM level, independent of what language or client you are using.

For example, calling suicideselfdestruct(address) sends all of the contract's current balance to address.

This is useful when you are finished with a contract, because it costs far less gas than just sending the balance with address.send(this.balance).

In fact, the SUICIDESELFDESTRUCT opcode uses negative gas because the operation frees up space on the blockchain by clearing all of the contract's data.

This negative gas deducts from the total gas cost of the transaction, so if you're doing some clean-up operations first, SUICIDESELFDESTRUCT can reduce your gas costs.

Suicides in Ethereum are an operation (an OPCODE actually) at the EVM level, independent of what language or client you are using.

For example, calling suicide(address) sends all of the contract's current balance to address.

This is useful when you are finished with a contract, because it costs far less gas than just sending the balance with address.send(this.balance).

In fact, the SUICIDE opcode uses negative gas because the operation frees up space on the blockchain by clearing all of the contract's data.

This negative gas deducts from the total gas cost of the transaction, so if you're doing some clean-up operations first, SUICIDE can reduce your gas costs.

Selfdestructs in Ethereum are an operation (an OPCODE actually) at the EVM level, independent of what language or client you are using.

For example, calling selfdestruct(address) sends all of the contract's current balance to address.

This is useful when you are finished with a contract, because it costs far less gas than just sending the balance with address.send(this.balance).

In fact, the SELFDESTRUCT opcode uses negative gas because the operation frees up space on the blockchain by clearing all of the contract's data.

This negative gas deducts from the total gas cost of the transaction, so if you're doing some clean-up operations first, SELFDESTRUCT can reduce your gas costs.

Source Link
Tjaden Hess
  • 37.3k
  • 11
  • 91
  • 118

Suicides in Ethereum are an operation (an OPCODE actually) at the EVM level, independent of what language or client you are using.

For example, calling suicide(address) sends all of the contract's current balance to address.

This is useful when you are finished with a contract, because it costs far less gas than just sending the balance with address.send(this.balance).

In fact, the SUICIDE opcode uses negative gas because the operation frees up space on the blockchain by clearing all of the contract's data.

This negative gas deducts from the total gas cost of the transaction, so if you're doing some clean-up operations first, SUICIDE can reduce your gas costs.