Skip to content

Commit

Permalink
fix balance burn message
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield committed Mar 28, 2024
1 parent 22399a7 commit e9a04fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCon
interpreter.evm.StateDB.SubBalance(scope.Contract.Address(), balance)
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance)
interpreter.evm.StateDB.Selfdestruct6780(scope.Contract.Address())
if beneficiary.Bytes20() == scope.Contract.Address() {
// Arbitrum: calling selfdestruct(this) burns the balance
interpreter.evm.StateDB.ExpectBalanceBurn(balance)
}
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
tracer.CaptureEnter(SELFDESTRUCT, scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance)
tracer.CaptureExit([]byte{}, 0, nil)
Expand Down

0 comments on commit e9a04fe

Please sign in to comment.