Skip to content

Commit

Permalink
fix: fix SELFDESTRUCT to address(this) in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
iavl committed Jan 16, 2024
1 parent ac28d2c commit 3e16ff6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext
}
beneficiary := scope.Stack.pop()
balance := interpreter.evm.StateDB.GetBalance(scope.Contract.Address())
interpreter.evm.StateDB.SubBalance(scope.Contract.Address(), balance)
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance)
interpreter.evm.StateDB.SelfDestruct(scope.Contract.Address())
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
Expand Down

0 comments on commit 3e16ff6

Please sign in to comment.