EIP-3529: Remove the SELFDESTRUCT refund.

- remove it from both nim-evm and nim-evm2
This commit is contained in:
jangko 2021-06-28 20:03:50 +07:00
parent e08c9ef2d9
commit 8982e6c649
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,7 @@
import
options, sets,
eth/common, chronicles, ../db/accounts_cache,
../transaction,
../transaction, ../forks,
./computation, ./interpreter, ./state, ./types
proc execComputation*(c: Computation) =
@ -19,6 +19,8 @@ proc execComputation*(c: Computation) =
c.execCallOrCreate()
if c.isSuccess:
if c.fork < FkLondon:
# EIP-3529: Reduction in refunds
c.refundSelfDestruct()
shallowCopy(c.vmState.selfDestructs, c.selfDestructs)
shallowCopy(c.vmState.logEntries, c.logEntries)

View File

@ -89,6 +89,8 @@ proc execComputation*(c: Computation) =
c.execCallOrCreate()
if c.isSuccess:
if c.fork < FkLondon:
# EIP-3529: Reduction in refunds
c.refundSelfDestruct()
shallowCopy(c.vmState.selfDestructs, c.selfDestructs)
shallowCopy(c.vmState.logEntries, c.logEntries)