import { ethers } from "hardhat" ; export interface DebugLog { pc : number ; op : string ; gasCost : number ; depth : number ; stack : string [ ] ; memory : string [ ] ; } export interface DebugTransactionResult { gas : number ; failed : boolean ; returnValue : string ; structLogs : DebugLog [ ] ; } export async function debugTransaction ( txHash , disableMemory = true , disableStorage = true ) { const debugTx = async ( hash ) => ethers . provider . send ( 'debug_traceTransaction' , [ hash , { disableMemory , disableStorage } ] ) ; return debugTx ( txHash ) ; }