Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit ca7e22a

Browse files
committed
Implement supplemental gas for SUICIDE EIP150(1c) #413
1 parent 3907a6e commit ca7e22a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ethereum/vm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,10 @@ def vm_execute(ext, msg, code):
642642

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

0 commit comments

Comments
 (0)