Skip to content

Commit

Permalink
core/vm: Rename opSuicide to opSelfdestruct
Browse files Browse the repository at this point in the history
The opcode was renamed in the codebase in 2017, but the functions were kept unchanged.
  • Loading branch information
axic committed Nov 30, 2021
1 parent 163f166 commit 4fb7927
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ func opStop(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt
return nil, errStopToken
}

func opSuicide(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
beneficiary := scope.Stack.pop()
balance := interpreter.evm.StateDB.GetBalance(scope.Contract.Address())
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance)
Expand Down
2 changes: 1 addition & 1 deletion core/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ func newFrontierInstructionSet() JumpTable {
memorySize: memoryReturn,
},
SELFDESTRUCT: {
execute: opSuicide,
execute: opSelfdestruct,
dynamicGas: gasSelfdestruct,
minStack: minStack(1, 0),
maxStack: maxStack(1, 0),
Expand Down

0 comments on commit 4fb7927

Please sign in to comment.