From e9a04fe94b48c778165596d59b6e9684cc405e20 Mon Sep 17 00:00:00 2001 From: Rachel Bousfield Date: Wed, 27 Mar 2024 18:38:44 -0600 Subject: [PATCH] fix balance burn message --- core/vm/instructions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 4d90aaa208..ec7452331c 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -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)