MCPcopy Create free account
hub / github.com/CPChain/chain / EVM

Struct EVM

core/vm/evm.go:86–111  ·  view source on GitHub ↗

EVM is the Ethereum Virtual Machine base object and provides the necessary tools to run a contract on the given state with the provided context. It should be noted that any error generated through any of the calls should be considered a revert-state-and-consume-all-gas operation, no checks on specif

Source from the content-addressed store, hash-verified

84//
85// The EVM should never be reused and is not thread safe.
86type EVM struct {
87 // Context provides auxiliary blockchain related information
88 Context
89 // StateDB gives access to the underlying state
90 StateDB StateDB
91 // Depth is the current call stack
92 depth int
93
94 // chainConfig contains information about the current chain
95 chainConfig *configs.ChainConfig
96 // chain rules contains the chain rules for the current epoch
97 chainRules configs.Rules
98 // virtual machine configuration options used to initialise the
99 // evm.
100 vmConfig Config
101 // global (to this context) ethereum virtual machine
102 // used throughout the execution of the tx.
103 interpreter *Interpreter
104 // abort is used to abort the EVM calling operations
105 // NOTE: must be set atomically
106 abort int32
107 // callGasTemp holds the gas available for the current call. This is needed because the
108 // available gas is calculated in gasCall* according to the 63/64 rule and later
109 // applied in opCall*.
110 callGasTemp uint64
111}
112
113// NewEVM returns a new EVM. The returned EVM is not thread safe and should
114// only ever be used *once*.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected