Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger committed May 2, 2023
1 parent 03ca495 commit 06c795d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,9 @@ func (s *StateDB) SendAll(addr common.Address) bool {
if stateObject == nil {
return false
}
stateObject.sendalled = true
stateObject.data.Balance = new(big.Int)

stateObject.sendalled = true
return true

}

// SetTransientState sets transient storage for a given account. It
Expand Down
1 change: 1 addition & 0 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeCon
}
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.SendAll(scope.Contract.Address())
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/vm/opcodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ var opCodeToString = map[OpCode]string{
STATICCALL: "STATICCALL",
REVERT: "REVERT",
INVALID: "INVALID",
SELFDESTRUCT: "SELFDESTRUCT", // TODO: rename to self-destruct after EIP-4758 goes in
SELFDESTRUCT: "SELFDESTRUCT",
}

func (op OpCode) String() string {
Expand Down

0 comments on commit 06c795d

Please sign in to comment.