SelfDestructible¶
Description¶
SelfDestructible allows an inheriting contract to be destroyed by its owner, who must announce an intention to destroy it, and then wait for a four week cooling-off period before it can be destroyed. Any ether remaining in the contract at this time is forwarded to a nominated beneficiary.
Source: contracts/SelfDestructible.sol
Architecture¶
Inheritance Graph¶
Constants¶
SELFDESTRUCT_DELAY
¶
The duration (four weeks) that must be waited between self destruct initiation and actual destruction. That is the contract can only be destroyed after the timestamp initiationTime + SELFDESTRUCT_DELAY
.
Value: 4 weeks
Type: uint256
Variables¶
initiationTime
¶
The timestamp at which the self destruction was begun.
Type: uint256
selfDestructBeneficiary
¶
The address where any lingering eth in this contract will be sent.
Type: address
selfDestructInitiated
¶
True iff the contract is currently undergoing self destruction.
Type: bool
Constructor¶
constructor
¶
Initialises the inherited Owned
instance and nominates that owner as the initial self destruct beneficiary.
Details
Signature
()
Visibility
internal
State Mutability
nonpayable
Requires
Emits
Restricted Functions¶
initiateSelfDestruct
¶
Begins the self destruct countdown, updating initiationTime
and selfDestructInitiated
. Only once the delay has elapsed can the contract be destroyed.
Details
Signature
initiateSelfDestruct()
Visibility
external
State Mutability
nonpayable
Modifiers
Emits
selfDestruct
¶
If self destruction is active and the timer has elapsed, destroy this contract and forward its ether to selfDestructBeneficiary
.
Details
Signature
selfDestruct()
Visibility
external
State Mutability
nonpayable
Requires
Modifiers
Emits
setSelfDestructBeneficiary
¶
Changes the self destruct beneficiary.
Details
Signature
setSelfDestructBeneficiary(address payable _beneficiary)
Visibility
external
State Mutability
nonpayable
Requires
Modifiers
Emits
terminateSelfDestruct
¶
Resets the timer and disables self destruction.
Details
Signature
terminateSelfDestruct()
Visibility
external
State Mutability
nonpayable
Modifiers
Emits
Events¶
SelfDestructBeneficiaryUpdated
¶
The self destruct beneficiary was changed to the indicated new address.
Signature: SelfDestructBeneficiaryUpdated(address newBeneficiary)
SelfDestructInitiated
¶
Self destruction was initiated with the indicated delay time.
Signature: SelfDestructInitiated(uint256 selfDestructDelay)
SelfDestructTerminated
¶
Self destruction was terminated by the contract owner.
Signature: SelfDestructTerminated()
SelfDestructed
¶
The contract was destroyed, forwarding the ether on to the beneficiary.
Signature: SelfDestructed(address beneficiary)