Fix operation order during tracing suicide op code (#4409)

This commit is contained in:
iFA 2022-06-08 22:56:20 +02:00 committed by GitHub
parent 644d25d25d
commit bd96c698a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -837,10 +837,10 @@ func opSuicide(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]
callerAddr := scope.Contract.Address()
beneficiaryAddr := common.Address(beneficiary.Bytes20())
balance := interpreter.evm.IntraBlockState().GetBalance(callerAddr)
interpreter.evm.IntraBlockState().AddBalance(beneficiaryAddr, balance)
if interpreter.evm.Config().Debug {
interpreter.evm.Config().Tracer.CaptureSelfDestruct(callerAddr, beneficiaryAddr, balance.ToBig())
}
interpreter.evm.IntraBlockState().AddBalance(beneficiaryAddr, balance)
interpreter.evm.IntraBlockState().Suicide(callerAddr)
return nil, nil
}