Our contracts utilize the selfdestruct
opcode to force Ether transfers. While this approach is effective, it's important to note that selfdestruct was deprecated in EIP-6049 as it may be subjected in the future to potential breaking changes.
Our implementation should not be affected by these potential changes:
-
EIP-6049: Deprecation of
selfdestruct
selfdestruct
has been deprecated according to EIP-6049.- It may be subject to breaking changes in future Ethereum upgrades.
-
EIP-6780: SELFDESTRUCT only in same transaction
- Our implementation is not affected by EIP-6780.
- We use
selfdestruct
in the same transaction as contract creation, which is an exception in EIP-6780. - In this case,
selfdestruct
behaves as it did prior to the EIP:- The current execution frame halts.
- Contract data is deleted as previously specified.
- The entire account balance is transferred to the target.
- The account balance of the contract calling
selfdestruct
is set to 0.
-
Other Proposed Changes
- EIP-6046 and EIP-4758 proposed changes to
selfdestruct
behavior, but were not adopted.
- EIP-6046 and EIP-4758 proposed changes to
The primary function of these contracts is to force Ether transfers to any address, including contracts without a receive
function. While this can be useful, it comes with risks:
- Unexpected Behavior: Forcing Ether into a contract that isn't designed to handle it can lead to unexpected behavior.
- Balance Inconsistencies: It may create inconsistencies between a contract's actual balance and its internal accounting.
- Potential Exploits: In some cases, this could be exploited to manipulate contract logic that relies on Ether balances.
- Use these contracts with caution and only when absolutely necessary.
- Be aware of the potential risks and implications of forced Ether transfers.
- Keep an eye on future Ethereum upgrades that may affect
selfdestruct
behavior. - Consider alternative designs that don't rely on
selfdestruct
for long-term maintainability.
For the most up-to-date information, always refer to the latest Ethereum Improvement Proposals (EIPs) and Ethereum documentation.