debug_traceCall
Returns the number of possible tracing result by executing an eth_call within the context of the
given block execution. This method uses 1000 credits from your daily balance.
Infura restricts debug_traceCall to a select set of customers. Please
contact the Infura support team to ask about custom plans.
Parameters
-
Transaction object with the following fields:
from: (string) address (20 bytes) the transaction is sent from.to: (string) [required] address (20 bytes) the transaction is directed to.gas: (string) hexadecimal value of the gas provided for the transaction execution.eth_callconsumes zero gas, but this parameter may be needed by some executions.gasPrice: (string) hexadecimal value of thegasPriceused for each paid gas.maxPriorityFeePerGas: (string) maximum fee, in wei, the sender is willing to pay per gas above the base fee.maxFeePerGas: (string) maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas.value: (string) hexadecimal of the value sent with this transaction.data: (string) hash of the method signature and encoded parameters. See Ethereum contract ABI specification.
-
block parameter: [Required] hexadecimal block number, or one of the string tagslatest,earliest,pending, orfinalized. See the default block parameter.warningsafeisn't supported. Usefinalizedinstead. -
Optional tracing options object with the following fields:
tracer: (string) [optional] type of tracer. SupportscallTracerorprestateTracer.tracerConfig: (object) [optional] tracer configuration options:onlyTopCall: (boolean) [optional] whentrue, will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame.
Returns
Depending on the specified tracer type, returns a callTracer object or
prestateTracer object.
Example
Replace <YOUR-API-KEY> with an API key from your MetaMask Developer dashboard.
Request
- curl
- WSS
curl https://mantle-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "debug_traceCall", "params": [{"to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest", {"tracer": "callTracer"}], "id": 1}'
wscat -c wss://mantle-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "debug_traceCall", "params": [{"to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest", {"tracer": "callTracer"}], "id": 1}'
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0x0000000000000000000000000000000000000000",
"gas": "0x28cc0",
"gasUsed": "0x3635000",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"input": "0x70a082310000000000000000000000006e0d01a76c3cf4288372a29124a26d4353ee51be",
"value": "0x0",
"type": "CALL"
}
}