stylusTracer
for debugging Stylus contracts. This method returns detailed execution traces of transactions involving Stylus contracts by capturing metadata for each HostIO (calls the WasmVM makes to read and write data in the EVM). Combined with the contract’s source code, this gives developers complete visibility into transaction execution for debugging purposes.
Available on customized dedicated nodes onlyCustom JavaScript tracers are available as customized solutions on the Enterprise plan on dedicated nodes.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
hash
— the hash identifying a transaction.object
— (optional) an object identifying the type of tracer and its configuration:stylusTracer
— tracer that captures metadata for each HostIO executed during a Stylus transaction.
JSON-RPC example
Response types
stylusTracer
response
object
— thestylusTracer
traces object containing an array of HostIO metadata:name
— name of the executed HostIO.args
— arguments of the HostIO encoded as hex.outs
— outputs of the HostIO encoded as hex.startInk
— amount of Ink before executing the HostIO.endInk
— amount of Ink after executing the HostIO.address
— for *call HostIOs, the address of the called contract.steps
— for *call HostIOs, the steps performed by the called contract.
Use case
A key use case for thedebug_traceTransaction
method with stylusTracer
is debugging failed Stylus contract transactions. The tracer provides detailed information about each HostIO executed during the transaction, allowing developers to:
- Track the exact sequence of operations
- Monitor Ink consumption
- Identify where failures occurred
- Analyze interactions with other contracts