46.md

September 28, 2022 ยท View on GitHub

Unexpected Ether balance

Description:

Contracts can behave erroneously when they strictly assume a specific Ether balance. It is always possible to forcibly send ether to a contract (without triggering its fallback function), using selfdestruct, or by mining to the account. In the worst case scenario this could lead to DOS conditions that might render the contract unusable.

Remediation:

Avoid strict equality checks for the Ether balance in a contract.

References:

https://swcregistry.io/docs/SWC-132