✅ How to receive your contract Ether
- payable functions
- mining reward: contract addresses can be designated as the recipients of mining block rewards.
- from a destroyed contract: As discussed,
selfdestruct
lets you designate a backup address to receive the remaining ethers from the contract you are destroying.
If you use selfdestruct
- authenticate that the
msg.sender = owner
- emit an event for external dependencies on this contract and for future reference.
Ethernaut