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

Method Call

core/vm/evm.go:138–143  ·  view source on GitHub ↗

Call executes the contract associated with the addr with the given input as parameters. It also handles any necessary value transfer required and takes the necessary steps to create accounts and reverses the state in case of an execution error or failed value transfer.

(caller ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int)

Source from the content-addressed store, hash-verified

136// the necessary steps to create accounts and reverses the state in case of an
137// execution error or failed value transfer.
138func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, err error) {
139 // query addr from statedb,check if some proxy flag exist.
140 // if is proxy contract ,get real contract address,replace addr with real contract address
141 realAddress := GetRealContractAddress(evm, caller, addr, gas)
142 return evm.call(caller, realAddress, input, gas, value)
143}
144
145// Call executes the contract associated with the addr with the given input as
146// parameters. It also handles any necessary value transfer required and takes

Callers

nothing calls this directly

Calls 2

callMethod · 0.95
GetRealContractAddressFunction · 0.85

Tested by

no test coverage detected