Skip to content

Commit

Permalink
Implement supplemental gas for SUICIDE EIP150(1c) ethereum#413
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkonrad committed Oct 31, 2016
1 parent 3907a6e commit ca7e22a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ethereum/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,10 @@ def vm_execute(ext, msg, code):

if ext.post_anti_dos_hardfork():
# EIP150 Increase the gas cost of SUICIDE to 5000
extra_gas = opcodes.SUICIDE_SUPPLEMENTAL_GAS
extra_gas = opcodes.SUICIDE_SUPPLEMENTAL_GAS + \
(not ext.account_exists(to)) * opcodes.GCALLNEWACCOUNT
# ^ EIP150(1c) If SUICIDE hits a newly created account, it
# triggers an additional gas cost of 25000 (similar to CALLs)
if not eat_gas(compustate, extra_gas):
return vm_exception("OUT OF GAS")

Expand Down

0 comments on commit ca7e22a

Please sign in to comment.