Solidity debugger library
Required Parameters
To start the debugger session, you'll need the following parameters:
-
txHash
- A transaction hash (prefixed with0x
), for the transaction to debug -
provider
- A ethers.js provider instance (see ethers.js) -
contracts
- An array of contract objects, with the following properties:contractName
- The name of the contractsource
- The full Solidity source codesourcePath
- (optional) the path to the Solidity file on diskast
- The Solidity compiler's output AST (new style, notlegacyAST
)binary
-0x
-prefixed string with the binary used to create a contract instancesourceMap
- The Solidity compiler output source map for the creation binarydeployedBinary
-0x
-prefixed string with the on-chain binary for a contract instancedeployedSourceMap
- The source map corresponding to the on-chain binary (from the Solidity compiler)
-
files
- An array of sourcePaths representing file indexes (For example:/Users/username/etherlimeProject/contracts/LimeFactory.sol
)
Run
- Start the debugger session by constructing a Debugger instance with
.forTx()
and then.connect()
to it:
; let bugger = await Debugger ; let session = bugger;
- Resolve the session's
ready()
promise:
await session;
- Use the provided public methods on the
session
instance in order to step through the trace for the transaction:
session;session;session;
- Access data provided by the debugger via the
session.view()
interface, and the provided selectors:
let ast data evm solidity trace = Debuggerselectors; let variables = session;let sourceRange = session;
License
MIT (c) 2019 Truffle, LimeChain LTD