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.