Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 857 Bytes

unexpected-ether-balance.md

File metadata and controls

12 lines (8 loc) · 857 Bytes

Unexpected Ether Balance

Since it is always possible to send Ether to a contract, see Forcibly Sending Ether to a Smart Contract, if a contract assumes a specific balance, it is vulnerable to attack.

Say we have a contract that prevents all functions from executing if there is any Ether stored in the contract. If a malicious user decides to exploit this by forcibly sending Ether, they will cause a DoS, rendering the contract unusable. For this reason, it's important to never use strict equality checks for the balance of Ether in a contract.

Sources