Skip to content

Commit

Permalink
Add balance acocunting to opSelfdestruct6780
Browse files Browse the repository at this point in the history
The same logic exists in opSelfdestruct
  • Loading branch information
tsahee committed Nov 25, 2024
1 parent 46fee83 commit 374fc17
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 @@ -857,6 +857,10 @@ func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCon
interpreter.evm.StateDB.SubBalance(scope.Contract.Address(), balance, tracing.BalanceDecreaseSelfdestruct)
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance, tracing.BalanceIncreaseSelfdestruct)
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.ToBig())
}
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
if tracer.OnEnter != nil {
tracer.OnEnter(interpreter.evm.depth, byte(SELFDESTRUCT), scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance.ToBig())
Expand Down

0 comments on commit 374fc17

Please sign in to comment.