-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not overwrite account balances when creating contracts (#437)
Transaction [0x9aac76c9ed191da631b5e70c8824f2ad106a0f5147d57c611ed64653734dd85f](https://etherscan.io/tx/0x9aac76c9ed191da631b5e70c8824f2ad106a0f5147d57c611ed64653734dd85f) was failing consensus at [block 243826](https://etherscan.io/block/243826) because it was a `Contract Create` to an account that already had a balance. Before creating a contract we make sure that contract doesn't already exist. Before this commit we were using using `Account.exists?` for that check. `Account.exists?` checks the balance of an account as well as whether it's contract code is set. This was incorrect. Instead now use `Account.is_simple_account?` which just checks if an account has it's contract code set. This allows for a sneaky trick called hiding ether described [here](http://swende.se/blog/Ethereum_quirks_and_vulns.html) as `Quirk #1 - hiding in plain sight`.
- Loading branch information
1 parent
59cf2ea
commit bf7f7a4
Showing
7 changed files
with
96 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters