@ -182,11 +182,12 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
}
snapshot := evm . StateDB . Snapshot ( )
p , isPrecompile := evm . precompile ( addr )
debug := evm . Config . Tracer != nil
if ! evm . StateDB . Exist ( addr ) {
if ! isPrecompile && evm . chainRules . IsEIP158 && value . Sign ( ) == 0 {
// Calling a non existing account, don't do anything, but ping the tracer
if evm . Config . D ebug {
if d ebug {
if evm . depth == 0 {
evm . Config . Tracer . CaptureStart ( evm , caller . Address ( ) , addr , false , input , gas , value )
evm . Config . Tracer . CaptureEnd ( ret , 0 , nil )
@ -202,7 +203,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
evm . Context . Transfer ( evm . StateDB , caller . Address ( ) , addr , value )
// Capture the tracer start/end events in debug mode
if evm . Config . D ebug {
if d ebug {
if evm . depth == 0 {
evm . Config . Tracer . CaptureStart ( evm , caller . Address ( ) , addr , false , input , gas , value )
defer func ( startGas uint64 ) { // Lazy evaluation of the parameters
@ -272,7 +273,7 @@ func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte,
var snapshot = evm . StateDB . Snapshot ( )
// Invoke tracer hooks that signal entering/exiting a call frame
if evm . Config . Debug {
if evm . Config . Tracer != nil {
evm . Config . Tracer . CaptureEnter ( CALLCODE , caller . Address ( ) , addr , input , gas , value )
defer func ( startGas uint64 ) {
evm . Config . Tracer . CaptureExit ( ret , startGas - gas , err )
@ -313,7 +314,7 @@ func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []by
var snapshot = evm . StateDB . Snapshot ( )
// Invoke tracer hooks that signal entering/exiting a call frame
if evm . Config . Debug {
if evm . Config . Tracer != nil {
// NOTE: caller must, at all times be a contract. It should never happen
// that caller is something other than a Contract.
parent := caller . ( * Contract )
@ -367,7 +368,7 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte
evm . StateDB . AddBalance ( addr , big0 )
// Invoke tracer hooks that signal entering/exiting a call frame
if evm . Config . Debug {
if evm . Config . Tracer != nil {
evm . Config . Tracer . CaptureEnter ( STATICCALL , caller . Address ( ) , addr , input , gas , nil )
defer func ( startGas uint64 ) {
evm . Config . Tracer . CaptureExit ( ret , startGas - gas , err )
@ -450,7 +451,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
contract := NewContract ( caller , AccountRef ( address ) , value , gas )
contract . SetCodeOptionalHash ( & address , codeAndHash )
if evm . Config . Debug {
if evm . Config . Tracer != nil {
if evm . depth == 0 {
evm . Config . Tracer . CaptureStart ( evm , caller . Address ( ) , address , true , codeAndHash . code , gas , value )
} else {
@ -493,7 +494,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
}
}
if evm . Config . Debug {
if evm . Config . Tracer != nil {
if evm . depth == 0 {
evm . Config . Tracer . CaptureEnd ( ret , gas - contract . Gas , err )
} else {