Permalink
Browse files

Possible DAO HF impl for reference

  • Loading branch information...
vub vub
vub authored and vub committed Jun 29, 2016
1 parent d5c822c commit 611252b630981a93bd348cc3ed155a75ad71158b
Showing with 13 additions and 1 deletion.
  1. +8 −0 ethereum/blocks.py
  2. +5 −1 ethereum/config.py
View
@@ -1177,6 +1177,14 @@ def revert(self, mysnapshot):
self.ether_delta = mysnapshot['ether_delta']
def initialize(self, parent):
# DAO fork
if self.number == self.config["DAO_FORK_BLKNUM"]:
dao_main_addr = utils.normalize_address(self.config["DAO_MAIN_ADDR"])
for acct in map(utils.normalize_address, self.config["DAO_ADDRESS_LIST"]):

This comment has been minimized.

Show comment
Hide comment
@beenhero

beenhero Jun 29, 2016

is acct a typo here? seems you need to pass through addr :)

@beenhero

beenhero Jun 29, 2016

is acct a typo here? seems you need to pass through addr :)

self.delta_balance(dao_main_addr, self.get_balance(addr))
self.set_balance(addr, 0)
self.set_code(dao_main_addr, self.config["DAO_NEWCODE"])
# Likely metropolis changes
if self.number == self.config["METROPOLIS_FORK_BLKNUM"]:
self.set_code(utils.normalize_address(self.config["METROPOLIS_STATEROOT_STORE"]), self.config["METROPOLIS_GETTER_CODE"])
self.set_code(utils.normalize_address(self.config["METROPOLIS_BLOCKHASH_STORE"]), self.config["METROPOLIS_GETTER_CODE"])
View
@@ -54,7 +54,11 @@
METROPOLIS_WRAPAROUND=65536,
METROPOLIS_GETTER_CODE='6000355460205260206020f3'.decode('hex'),
METROPOLIS_DIFF_ADJUSTMENT_CUTOFF=9,
# Metropolis fork
# DAO fork
DAO_FORK_BLKNUM = 9999998,
DAO_ADDRESS_LIST = [],
DAO_MAIN_ADDR = '0xbb9bc244d798123fde783fcc1c72d3bb8c189413',
DAO_NEWCODE = ''
)
assert default_config['NEPHEW_REWARD'] == \
default_config['BLOCK_REWARD'] // 32

0 comments on commit 611252b

Please sign in to comment.