From f5efa4f7dd4ed926a8f88738f89daf7ab4c474e2 Mon Sep 17 00:00:00 2001 From: ethers Date: Fri, 17 May 2019 02:04:45 +0800 Subject: [PATCH] Don't assume contracts are created with zero balance Fix #61 https://github.com/ConsenSys/smart-contract-best-practices/issues/61 Thanks @SergioDemianLerner --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 1996be1..ec4d700 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,9 @@ The attacker can do this by creating a contract, funding it with 1 wei, and invo `selfdestruct(victimAddress)`. No code is invoked in `victimAddress`, so it cannot be prevented. +### Don't assume contracts are created with zero balance + +An attacker can send wei to the address of a contract before it is created. Contracts should not assume that its initial state contains a zero balance. See [issue 61](https://github.com/ConsenSys/smart-contract-best-practices/issues/61) for more details. ### Remember that on-chain data is public